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(data, enc, cb);
};
serve(req, res, function (err) {
if (err) { return done(err); }
index(req, res, function (err) {
function serveStatic() {
serve(req, res, function (err) {
if (err) { return done(err); }
if (opts.expressApp) {
opts.expressApp(req, res, done);
}
else {
done();
}
index(req, res, done);
});
});
}
if (opts.expressApp) {
opts.expressApp(req, res, serveStatic);
}
else {
serveStatic();
}
};
};