Merge branch 'master' of git.noarch.de:hardi/opt-cc

pull/1/head
Florian Hartwich 2017-05-17 13:07:50 +02:00
commit 88f1d3130b
1 changed files with 10 additions and 5 deletions

View File

@ -48,19 +48,24 @@ app.use(favicon(path.join(__dirname + '/..', 'public', 'favicon.ico')));
app.use(express.static(path.join(__dirname + '/..', 'public'))); app.use(express.static(path.join(__dirname + '/..', 'public')));
app.use(bodyParser.json()); app.use(bodyParser.json());
// logging
if (process.env.NODE_ENV !== config.test.env) {
app.use(requestLogger('dev'));
}
// API request checks for API-version and JSON etc. // API request checks for API-version and JSON etc.
app.use(restAPIchecks); app.use(restAPIchecks);
// Routes ****************************************************** // Routes ******************************************************
app.use(urls.auth, authenticateRouter);
app.use(urls.signatures, signatureRouter); app.use(urls.signatures, signatureRouter);
// initialize logging here to exclude /signature requests
if (!process.env.NODE_ENV) {
// development logging
app.use(requestLogger('dev'));
} else if (process.env.NODE_ENV !== config.test.env) {
// production logging, apache style
app.use(requestLogger(':date :remote-addr :method :url :status :response-time ms'));
}
app.use(urls.auth, authenticateRouter);
app.use(urls.overview, overviewRouter); app.use(urls.overview, overviewRouter);
app.use(urls.users, userRouter); app.use(urls.users, userRouter);
app.use(urls.squads, squadRouter); app.use(urls.squads, squadRouter);