Skip to content

Instantly share code, notes, and snippets.

View remibantos's full-sized avatar

Rémi B remibantos

  • France
View GitHub Profile
@kafkahw
kafkahw / mock_api_webpack
Created January 19, 2017 20:58
Mock API with webpack
https://webpack.github.io/docs/webpack-dev-server.html#api
If mocking API is needed when running webpack dev server, you can set it up in your webpack config as follows:
devServer: {
setup: function(app) {
// Here you can access the Express app object and add your own custom middleware to it.
// For example, to define custom handlers for some paths:
// app.get('/some/path', function(req, res) {
// res.json({ custom: 'response' });
// });
},