diff options
| author | Pitu <[email protected]> | 2017-01-17 20:12:58 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-01-17 20:12:58 -0300 |
| commit | 075e1baac71917016fe943b30482532ee9824caf (patch) | |
| tree | 3acd11f65a48b9757f01a5c740c3aa2182033b32 /lolisafe.js | |
| parent | Better links on bottom and displaying max file size (diff) | |
| download | host.fuwn.me-075e1baac71917016fe943b30482532ee9824caf.tar.xz host.fuwn.me-075e1baac71917016fe943b30482532ee9824caf.zip | |
Better static routes
Diffstat (limited to 'lolisafe.js')
| -rw-r--r-- | lolisafe.js | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/lolisafe.js b/lolisafe.js index 91f6de5..8f7b999 100644 --- a/lolisafe.js +++ b/lolisafe.js @@ -20,28 +20,9 @@ safe.use('/' + prefix, express.static('./uploads')) safe.use('/', express.static('./public')) safe.use('/api', api) -safe.get('/', function (req, res, next) { - res.sendFile('home.html', { - root: './pages/' - }) -}) - -safe.get('/panel', function (req, res, next) { - res.sendFile('panel.html', { - root: './pages/' - }) -}) - -safe.use(function (req, res, next) { - res.status(404).sendFile('404.html', { - root: './pages/error/', - }) -}) - -safe.use(function (err, req, res, next) { - res.status(500).sendFile('500.html', { - root: './pages/error/', - }) -}) +safe.get('/', (req, res, next) => res.sendFile('home.html', { root: './pages/' })) +safe.get('/panel', (req, res, next) => res.sendFile('panel.html', { root: './pages/' })) +safe.use((req, res, next) => res.status(404).sendFile('404.html', { root: './pages/error/' })) +safe.use((req, res, next) => res.status(500).sendFile('500.html', { root: './pages/error/' })) safe.listen(config.port, () => console.log(`loli-safe started on port ${config.port}`))
\ No newline at end of file |