diff --git a/app.js b/app.js index 521972c..5095feb 100644 --- a/app.js +++ b/app.js @@ -28,7 +28,7 @@ const auth = require('./routes/auth'); app.use('/api/lists', auth.required, require('./routes/lists')); app.use('/api/todos', auth.required, require('./routes/todos')); -if (process.env.NODE_ENV === 'prod') { +if (process.env.NODE_ENV === 'production') { app.use(express.static(path.join(__dirname, 'react/build'))); app.use('*', express.static(path.join(__dirname, 'react/build/index.html'))); } diff --git a/config/index.js b/config/index.js index f8adad0..2b1afdd 100644 --- a/config/index.js +++ b/config/index.js @@ -1,6 +1,6 @@ const env = process.env.NODE_ENV; -const prod = { +const production = { app: { port: process.env.PORT, }, @@ -10,7 +10,7 @@ const prod = { secret: process.env.SECRET, }; -const dev = { +const development = { app: { port: process.env.DEV_PORT || 4000, }, @@ -25,9 +25,9 @@ const test = { }; const config = { - prod, - dev, + production, + development, test, }; -module.exports = config[env] || config.prod; +module.exports = config[env] || config.production; diff --git a/package.json b/package.json index 20e6955..84defab 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "app.js", "scripts": { "start": "node ./app.js", - "debug": "cross-env NODE_ENV=dev npx nodemon --inspect ./app.js", + "debug": "cross-env NODE_ENV=development npx nodemon --inspect ./app.js", "test": "cross-env NODE_ENV=test jest", "postinstall": "cd react && npm install && npm run build" },