This commit is contained in:
parent
4852ac13af
commit
241e328d93
2 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,7 @@ import * as http from 'http';
|
|||
import * as https from 'https';
|
||||
import * as cluster from 'cluster';
|
||||
import * as express from 'express';
|
||||
import * as morgan from 'morgan';
|
||||
import vhost = require('vhost');
|
||||
|
||||
import config from './conf';
|
||||
|
@ -17,6 +18,10 @@ import config from './conf';
|
|||
const app = express();
|
||||
app.disable('x-powered-by');
|
||||
|
||||
// Log
|
||||
app.use(morgan(
|
||||
process.env.NODE_ENV == 'production' ? 'combined' : 'dev'));
|
||||
|
||||
// Drop request that without 'Host' header
|
||||
app.use((req, res, next) => {
|
||||
if (!req.headers['host']) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue