Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
fix: calling middleware in add should find open ports. fixes #130 (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape authored May 11, 2018
1 parent 9cabb7f commit c9235b5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@ module.exports = (options) => {
});
},
start() {
if (typeof options.add === 'function') {
options.add(app, middleware, options);
}

if (!middleware.content.called) {
middleware.content();
}

server.once('listening', () => {
const uri = `${options.protocol}://${options.host}:${options.port}`;

Expand Down Expand Up @@ -131,6 +123,14 @@ module.exports = (options) => {
options.hot.port = hotPort;
}

if (typeof options.add === 'function') {
options.add(app, middleware, options);
}

if (!middleware.content.called) {
middleware.content();
}

// allow consumers to specifically order middleware
if (!middleware.webpack.called) {
middleware.webpack();
Expand Down

0 comments on commit c9235b5

Please sign in to comment.