Skip to content

Commit

Permalink
added serve code for handling 404 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tektaxi authored and psvenk committed Dec 9, 2020
1 parent 8d1c301 commit afbc9ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ app.get('/logout', async (req, res) => {
res.redirect('/login.html');
});

app.get('/404', (req, res) => res.sendFile(__dirname + '/public/404.html'));

app.use((req, res) => {
res.status(404);
res.redirect("/404");
});


// app.post('/set-settings', async (req, res) => {
// // TODO: Sanitization
// let key = crypto.createHash('md5').update(req.session.username).digest('hex');
Expand Down

0 comments on commit afbc9ad

Please sign in to comment.