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

fix: calling middleware in add should find open ports. fixes #130 #133

Merged
merged 1 commit into from
May 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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