mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
change 'prod' to 'production',
This commit is contained in:
2
app.js
2
app.js
@@ -28,7 +28,7 @@ const auth = require('./routes/auth');
|
|||||||
app.use('/api/lists', auth.required, require('./routes/lists'));
|
app.use('/api/lists', auth.required, require('./routes/lists'));
|
||||||
app.use('/api/todos', auth.required, require('./routes/todos'));
|
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')));
|
||||||
app.use('*', express.static(path.join(__dirname, 'react/build/index.html')));
|
app.use('*', express.static(path.join(__dirname, 'react/build/index.html')));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const env = process.env.NODE_ENV;
|
const env = process.env.NODE_ENV;
|
||||||
|
|
||||||
const prod = {
|
const production = {
|
||||||
app: {
|
app: {
|
||||||
port: process.env.PORT,
|
port: process.env.PORT,
|
||||||
},
|
},
|
||||||
@@ -10,7 +10,7 @@ const prod = {
|
|||||||
secret: process.env.SECRET,
|
secret: process.env.SECRET,
|
||||||
};
|
};
|
||||||
|
|
||||||
const dev = {
|
const development = {
|
||||||
app: {
|
app: {
|
||||||
port: process.env.DEV_PORT || 4000,
|
port: process.env.DEV_PORT || 4000,
|
||||||
},
|
},
|
||||||
@@ -25,9 +25,9 @@ const test = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
prod,
|
production,
|
||||||
dev,
|
development,
|
||||||
test,
|
test,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config[env] || config.prod;
|
module.exports = config[env] || config.production;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./app.js",
|
"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",
|
"test": "cross-env NODE_ENV=test jest",
|
||||||
"postinstall": "cd react && npm install && npm run build"
|
"postinstall": "cd react && npm install && npm run build"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user