Email Login

This commit is contained in:
Georg Reisinger
2019-02-24 19:27:42 +01:00
parent f853a2bf0f
commit 3baf79e8f6
39 changed files with 3246 additions and 2982 deletions

View File

@ -15,7 +15,9 @@ app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.urlencoded({
extended: false
}));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
@ -23,14 +25,14 @@ app.use(axios);
app.use('/users', usersRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
app.use(function (req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function(err, req, res, next) {
app.use(function (err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
@ -40,4 +42,4 @@ app.use(function(err, req, res, next) {
res.render('error');
});
module.exports = app;
module.exports = app;