From 41a5da19f5814534c4522a69285f14bd0860571a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Thu, 9 May 2024 10:49:16 +0200 Subject: [PATCH] docfix/Enhance the redme file regarding the build process --- .gitignore | 2 +- README.md | 24 ++++++++++++++++++++---- server/app.ts | 2 -- tsconfig.server.json | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index bfafd79..eeeba00 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ node_modules .DS_Store dist dist-ssr -server-dist +dist-server coverage *.local .env diff --git a/README.md b/README.md index a290669..909406b 100644 --- a/README.md +++ b/README.md @@ -56,17 +56,33 @@ npm test:unit ## Compile and Minify for Production -##### Build +##### Build API-Explorer II front-end ```sh -npm run build +npm run-script build ``` -##### Start the backend server +##### Build API-Explorer II back-end + ```sh -npx ts-node /server/app.ts +npm run-script build-server ``` +##### Start API-Explorer II back-end +```sh +npx ts-node /server/app.js +``` + +##### Check the status of API-Explorer II back-end +``` +Please find a message at a log file similar to this one: + +Backend is running. You can check a status at http://localhost:8085/api/status + +and use the link to check the status +``` + + ##### Nginx deployment ```config diff --git a/server/app.ts b/server/app.ts index 786d80b..0015bcc 100644 --- a/server/app.ts +++ b/server/app.ts @@ -10,8 +10,6 @@ import path from 'path' const port = 8085 const app: Application = express() -const host = process.env.VITE_OBP_API_EXPLORER_HOST -const httpsOrNot = host ? (host.indexOf('https://') == 0 ? true : false) : true // Initialize client. console.log(`--- Redis setup -------------------------------------------------`) diff --git a/tsconfig.server.json b/tsconfig.server.json index 241bee4..e7ed8a1 100644 --- a/tsconfig.server.json +++ b/tsconfig.server.json @@ -3,7 +3,7 @@ "module": "commonjs", "esModuleInterop": true, "target": "ES6", - "outDir": "server-dist", + "outDir": "dist-server", "rootDir": "server", "resolveJsonModule": true, "emitDecoratorMetadata": true,