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

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