add prod script, fix bug

This commit is contained in:
2025-01-30 10:51:43 +05:30
parent a157cb3fed
commit def1dce168
2 changed files with 3 additions and 2 deletions

View File

@@ -6,7 +6,8 @@
"scripts": { "scripts": {
"build": "tsc -p tsconfig.json", "build": "tsc -p tsconfig.json",
"start": "tsc -w & node --watch --env-file=.env dist/index.js", "start": "tsc -w & node --watch --env-file=.env dist/index.js",
"load_test": "export $(cat .env | xargs) && k6 run ./test/loadTest.js" "load_test": "export $(cat .env | xargs) && k6 run ./test/loadTest.js",
"prod": "node --env-file=.env dist/index.js"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

View File

@@ -3,7 +3,7 @@ import app from "./server";
(async () => { (async () => {
const PORT = parseInt(process.env.PORT ?? "8000"); const PORT = parseInt(process.env.PORT ?? "8000");
const DB_URI = process.env.DB_TEST ?? ""; const DB_URI = process.env.DB_URI ?? "";
await mongoose.connect(DB_URI); await mongoose.connect(DB_URI);
await app.listen({ port: PORT, host: "0.0.0.0" }); await app.listen({ port: PORT, host: "0.0.0.0" });