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'], passwords: ['fartsex'],
url: 'http://localhost:3001', url: 'http://localhost:3001',
rootRedirect: 'https://hippoz.xyz/',
storagePath: '/tmp/yes', storagePath: '/tmp/yes',
fileTypes: fileTypes, fileTypes: fileTypes,
files: { files: {

View file

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