Proxy outgoing requests to custom API server in dev mode
aneeshd16 opened this issue · 1 comments
aneeshd16 commented
Hi, in prod mode, I would be serving the dist
folder via my node server, all outgoing API requests from the client will be on the /api/*
path. This works fine.
In dev mode, the client is served at localhost:3000 by the dev server, and I need to proxy all outgoing requests on the /api/*
path to a different port on localhost. I added this to webpack.dev.config.js
, but it does not work.
config.proxy = {
'/api/*': 'http://localhost:4000/'
};
Thanks for the help!
fesor commented
https://github.com/AngularClass/NG6-starter/blob/master/gulpfile.babel.js#L79
Here you can add browsersync proxy config.