Fix production logging

pull/1/head
Florian Hartwich 2017-05-23 13:26:26 +02:00
parent a3df38263e
commit d7052b691c
4 changed files with 8 additions and 4 deletions

View File

@ -7,6 +7,10 @@ module.exports = {
db: 'cc',
},
dev: {
env: 'dev'
},
test: {
port: 3001,
db: 'cc-test',

View File

@ -8,7 +8,7 @@
"private": true,
"scripts": {
"start": "NODE_ENV=production node server.js",
"dev": "nodemon server.js",
"dev": "NODE_ENV=dev nodemon server.js",
"test": "mocha --require ./test/config/spec_helper.js",
"e2e": "NODE_ENV=test node server.js"
},

View File

@ -55,7 +55,7 @@ app.use(restAPIchecks);
app.use(urls.signatures, signatureRouter);
// initialize logging here to exclude /signature requests
if (!process.env.NODE_ENV) {
if (process.env.NODE_ENV === config.dev.env) {
// development logging
app.use(requestLogger('dev'));
} else if (process.env.NODE_ENV !== config.test.env) {

View File

@ -4,8 +4,8 @@
"license": "MIT",
"private": true,
"scripts": {
"start": "npm run deploy-static-prod && NODE_ENV=production node ./api/server.js",
"dev": "npm run deploy-static && nodemon ./api/server.js",
"start": "npm run deploy-static-prod && npm start --prefix ./api",
"dev": "npm run deploy-static && npm run dev --prefix ./api",
"deploy-static": "cd ./static && ng build && ln -s ../api/resource/ ../public/resource",
"deploy-static-prod": "cd ./static && ng build --env=prod && ln -s ../api/resource/ ../public/resource",
"postinstall": "npm install --prefix ./static && npm install --prefix ./api",