bugfix 405 Method Not Allowed

This commit is contained in:
AJ ONeal 2016-08-06 14:15:12 -06:00
parent c8db5bad73
commit 2bd79007de
1 changed files with 12 additions and 10 deletions

22
app.js
View File

@ -44,17 +44,19 @@ module.exports = function (opts) {
this.__write(livereload); this.__write(livereload);
this.__write(data, enc, cb); this.__write(data, enc, cb);
}; };
serve(req, res, function (err) {
if (err) { return done(err); } function serveStatic() {
index(req, res, function (err) { serve(req, res, function (err) {
if (err) { return done(err); } if (err) { return done(err); }
if (opts.expressApp) { index(req, res, done);
opts.expressApp(req, res, done);
}
else {
done();
}
}); });
}); }
if (opts.expressApp) {
opts.expressApp(req, res, serveStatic);
}
else {
serveStatic();
}
}; };
}; };