update Fr 29. Mai 22:01:01 CEST 2020

This commit is contained in:
Robert Richter 2020-05-29 22:01:01 +02:00
parent 3c6431903e
commit 22ca5f47b3

View File

@ -49,38 +49,11 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp)
});
// API
app.get('/api', function (req, res) {
if (app_cfg.public.ext_privacy) {
res.redirect(app_cfg.public.url_privacy);
} else {
res.render('privacy', {
public: app_cfg.public,
title: 'Datenschutzerklärung',
user: req.user
});
};
});
// 404 abfangen und an error handler weiterleiten
app.use(function (req, res, next) {
var err = new Error('Seite nicht gefunden!');
err.status = 404;
app.get('/api', function (req, res, next) {
var err = new Error('Sie sind nicht berechtigt diese Seite aufzurufen!');
err.status = 403;
next(err);
});
// error handler
app.use(function (err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = app_cfg.global.development ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error', {
public: app_cfg.public,
user: req.user
});
});