parent
100430227c
commit
7687965219
|
@ -45,11 +45,11 @@ module.exports = function(config, auth, storage) {
|
||||||
// Static
|
// Static
|
||||||
app.get('/-/static/:filename', function(req, res, next) {
|
app.get('/-/static/:filename', function(req, res, next) {
|
||||||
var file = __dirname + '/static/' + req.params.filename
|
var file = __dirname + '/static/' + req.params.filename
|
||||||
fs.exists(file, function(exists) {
|
res.sendfile(file, function(err) {
|
||||||
if (exists) {
|
if (err.status === 404) {
|
||||||
res.sendfile(file)
|
next()
|
||||||
} else {
|
} else {
|
||||||
next( Error[404]('File Not Found') )
|
next(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -415,6 +415,9 @@ module.exports = function(config_hash) {
|
||||||
res.report_error(err)
|
res.report_error(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.get('/*', function(req, res, next) {
|
||||||
|
next( Error[404]('file not found') )
|
||||||
|
})
|
||||||
|
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue