New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I use middleware with webpack-dev-server? #285
Comments
The append middleware would not be triggered as the response already send. var server = new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
setup: function(app) {
app.use(function(req, res, next) {
console.log('Middleware triggered');
next();
});
},
stats: {
colors: true
}
}); assign the setup option with a function. |
Thanks! This works |
This was helpful to me as well, thanks @chemzqm |
This was helpful. FYI for someone It was deprecated like below (here)!
|
I am trying to solve this issue lahmatiy/component-inspector#9 (comment)
I tried
with no result.
Can middlewares used with webpack-dev-server somehow?
The text was updated successfully, but these errors were encountered: