fallback + script 404's cause weird errors
The fallback should be refactored so 404's caused by missing scripts to do not get redirected to index.html (the fallback). Because this causes weird console messages and hides the fact there is a 404.
@robertbaker Did you find a work around for this?
No.
On Tue, Aug 18, 2015, 7:59 AM Sagiv Frankel [email protected] wrote:
@robertbaker https://github.com/robertbaker Did you find a work around for this?
— Reply to this email directly or view it on GitHub https://github.com/schickling/gulp-webserver/issues/88#issuecomment-132240330 .
Not the best solution, but you can add middleware to pass through only the files you want:
- Just add the middleware property:
return function(req, res, next) {
if (req.url.indexOf('/app/assets') === 0 || req.url.indexOf('/static') === 0) {
return next();
}
res.statusCode = 404;
res.setHeader("Content-Type", "text/html");
res.write("no such static resource");
return res.end();
}