server: print explicit error if a file is not foundin assets/ or client/
This commit is contained in:
parent
0c57702a5b
commit
3a66388335
1 changed files with 8 additions and 1 deletions
|
|
@ -103,7 +103,14 @@ function httpRoute(req, res) {
|
|||
} else if (/^\/(assets|client)\//.test(url)){
|
||||
|
||||
if (prod) res.setHeader('Cache-Control', 'public, max-age=2592000')
|
||||
res.sendFile(path.resolve(__dirname + '/..' + url))
|
||||
try {
|
||||
res.sendFile(path.resolve(__dirname + '/..' + url))
|
||||
return true
|
||||
} catch(e) {}
|
||||
|
||||
console.error(`(ERROR, HTTP) File not found: ${url}`)
|
||||
res.writeHead(404)
|
||||
res.end()
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue