Merge pull request #62 from wardragon/dinupload

Change upload url to configurable
This commit is contained in:
Christoph Wiechert
2018-12-07 18:36:07 +01:00
committed by GitHub
3 changed files with 1514 additions and 1448 deletions

2949
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,9 @@ const config = {
"mailTemplate": 'mailto:?subject=File Transfer&body=You can download the files here: %%URL%%',
// see https://github.com/expressjs/morgan
// set to false to disable logging
"accessLog": ':date[iso] :method :url :status :response-time :remote-addr'
"accessLog": ':date[iso] :method :url :status :response-time :remote-addr',
//use to set custom upload url
"uploadAppPath": '/'
};

View File

@@ -41,7 +41,16 @@ app.get('/robots.txt', (req, res) => {
});
// Upload App
//
//
app.get('/', (req, res) => {
if (config.uploadAppPath != '/')
res.status(304).redirect(config.uploadAppPath);
else
res.sendFile(path.join(__dirname, '../public/html/upload.html'));
});
app.get(config.uploadAppPath, (req, res) => {
res.sendFile(path.join(__dirname, '../public/html/upload.html'));
});