Hello,
I am trying to use the webpack-dev-server
proxy in order to get around CORS
while developing in the browser with ionic serve
. As far as I can see, ionic2 is not using the ionic.project file any more and hence old solutions centred around that don’t seem to work. Therefore, I added
devServer: {
hot: true,
historyApiFallback: true,
proxy: {
'/api*': {
target: 'http://api.awesome.com',
secure: false,
}
}
}
to my webpack.config.js
. The configuration works when running it with webpack-dev-server directly as in
$ webpack-dev-server
However, it does not work when using
$ ionic serve
Clearly, this is inconvenient since I don’t want to miss out on the automatic build process provided by the latter if I change some files in my project.
Does anybody know how to use ionic serve
with a proxy?
Thanks,
Chris