diff --git a/server/nodemon.json b/server/nodemon.json index a3186d9..82d5041 100644 --- a/server/nodemon.json +++ b/server/nodemon.json @@ -1,5 +1,6 @@ { "watch": ["dist", "swagger.yaml", "../quests", "../packages"], "ext": "js,ts,yaml,yml", - "exec": "node dist/index.js" + "exec": "node dist/index.js", + "delay": 200 } diff --git a/server/package.json b/server/package.json index 8cf7db5..c360346 100644 --- a/server/package.json +++ b/server/package.json @@ -5,12 +5,12 @@ "type": "commonjs", "scripts": { "start": "node dist/index.js", - "dev": "concurrently \"yarn build -w\" \"nodemon\"", + "dev": "nodemon", "test": "yarn node --experimental-vm-modules $(yarn bin jest)", "setup": "node dist/cli/setup.js", "clean": "node dist/cli/clean.js", - "build": "tsc --build", - "build:quests": "node src/cli/build.js" + "build": "tsc", + "build:quests": "node dist/cli/build.js" }, "dependencies": { "@linux-odyssey/constants": "*", @@ -21,6 +21,7 @@ "commander": "^11.0.0", "connect-mongo": "^5.0.0", "dockerode": "^3.3.5", + "dotenv": "^16.4.1", "express": "^4.18.2", "express-rate-limit": "^7.1.3", "express-session": "^1.17.3", diff --git a/server/src/config.js b/server/src/config.js index c7734d3..d532306 100644 --- a/server/src/config.js +++ b/server/src/config.js @@ -1,6 +1,10 @@ import validator from 'validator' import { get } from './utils/env.js' +// Import dotenv and load ../.env +import dotenv from 'dotenv' +dotenv.config({ path: '../.env' }) + function getTrustProxies(key) { if (!process.env[key]) { return []