Skip to content
Permalink
Browse files

chore(router): support app.beforeStart in http router

  • Loading branch information...
huangyoukun committed Jun 25, 2018
1 parent f51c7c2 commit 8c3261a8ad1aae357f97680993cad4263644f2ed
Showing with 3 additions and 4 deletions.
  1. +3 −4 bin/proxy/http.route.js
@@ -539,16 +539,15 @@ function doRoute(req, res) {

if (modulePath && typeof modulePath.callback === 'function') {
const app = modulePath;

// if beforeStart exists
if (typeof app.beforeStart === 'function') {
modulePath = function(req, res, plug) {
return app.beforeStart(function() {
modulePath = (req, res, plug) => {
return app.beforeStart(() => {
app.callback()(req, res);
});
};
} else {
modulePath = function(req, res, plug) {
modulePath = (req, res, plug) => {
return app.callback()(req, res);
};
}

0 comments on commit 8c3261a

Please sign in to comment.
You can’t perform that action at this time.