mirror of
https://github.com/aurora-dot/pastel.codes.git
synced 2024-11-22 08:12:19 +00:00
Completed logging thing
This commit is contained in:
parent
95179cd76d
commit
6c98884e33
11
app.js
11
app.js
@ -9,13 +9,20 @@ var indexRouter = require('./routes/index');
|
|||||||
var aboutRouter = require('./routes/about');
|
var aboutRouter = require('./routes/about');
|
||||||
|
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
app.set('trust proxy', 'loopback,uniquelocal');
|
app.set('trust proxy', 'loopback,uniquelocal');
|
||||||
|
app.disable('x-powered-by');
|
||||||
|
|
||||||
// view engine setup
|
// view engine setup
|
||||||
app.set('views', path.join(__dirname, 'views'));
|
app.set('views', path.join(__dirname, 'views'));
|
||||||
app.set('view engine', 'pug');
|
app.set('view engine', 'pug');
|
||||||
|
|
||||||
app.use(logger('common'));
|
if (app.get('env') == 'production') {
|
||||||
|
app.use(logger('common', { skip: function(req, res) { return res.statusCode < 400 }, stream: __dirname + '/../morgan.log' }));
|
||||||
|
} else {
|
||||||
|
app.use(logger('dev'));
|
||||||
|
}
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.urlencoded({ extended: false }));
|
app.use(express.urlencoded({ extended: false }));
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
@ -27,8 +34,6 @@ app.use(sassMiddleware({
|
|||||||
}));
|
}));
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
app.disable('x-powered-by');
|
|
||||||
|
|
||||||
app.use('/', indexRouter);
|
app.use('/', indexRouter);
|
||||||
app.use('/about', aboutRouter);
|
app.use('/about', aboutRouter);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user