diff --git a/package.json b/package.json index 138ad34..be41df7 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "app.js", "scripts": { "dev": "nodemon src/app.js", - "start": "node src/app.js", - "docker:start": "node --env-file=.env src/app.js", + "start": "NODE_ENV=production node src/app.js", + "docker:start": "NODE_ENV=production node --env-file=.env src/app.js", "lint": "eslint .", "lint:fix": "eslint . --fix", "migrate": "node-pg-migrate -m ./src/migrations", diff --git a/src/app.js b/src/app.js index cf883a8..7f76367 100644 --- a/src/app.js +++ b/src/app.js @@ -13,7 +13,9 @@ import collectionRoutes from './routes/collections/index.js' import setRoutes from './routes/sets/index.js' import itemRoutes from './routes/items/index.js' -loadEnvFile() +if (process.env.NODE_ENV !== 'test') { + loadEnvFile() +} const app = express() const port = process.env.PORT || 3000