make redirect a config option

This commit is contained in:
hippoz 2020-10-25 13:42:09 +02:00
parent d84220b2c2
commit 051f7326ec
2 changed files with 6 additions and 3 deletions

View file

@ -11,6 +11,7 @@ module.exports = {
},
passwords: ['fartsex'],
url: 'http://localhost:3001',
rootRedirect: 'https://hippoz.xyz/',
storagePath: '/tmp/yes',
fileTypes: fileTypes,
files: {

View file

@ -74,9 +74,11 @@ const corsOptions = {
}
app.get('/', (req, res) => {
// res.render('upload');
// TODO: this is only for hippoz. remove the line below and uncomment the line above if you are not hippoz man
res.redirect(301, 'https://hippoz.xyz/');
if (!config.rootRedirect) {
res.render('upload');
} else {
res.redirect(301, config.rootRedirect);
}
});
app.get('/file/:filename', (req, res) => {