make it possible for nginx to serve the tracks instead
This commit is contained in:
parent
53cf8c5744
commit
d46c3eaf20
@ -141,7 +141,7 @@ router.get('/serve/by-id/:id', async (req, res, next) => {
|
||||
return res.download(fpath)
|
||||
}
|
||||
|
||||
res.sendFile(fpath)
|
||||
res.redirect('/file/track' + fpath.substring(values.directory.length))
|
||||
})
|
||||
|
||||
router.use((err, req, res, next) => {
|
||||
@ -150,6 +150,7 @@ router.use((err, req, res, next) => {
|
||||
})
|
||||
|
||||
app.use('/api', router)
|
||||
app.use('/file/track', express.static(path.resolve(values.directory)))
|
||||
app.use('/', express.static(path.join(__dirname, 'public')))
|
||||
|
||||
app.listen(port, '127.0.0.1', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user