-
Notifications
You must be signed in to change notification settings - Fork 12k
Support proxy to backend #1487
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
Support proxy to backend #1487
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
I think we should remove proxy and insecure proxy options. |
Can you include in the first comment a brief text description of your solution as well? It should help us review the code by giving it a overall summary. In regards to testing I talked a bit with @TheLarkInn and one way that stood out was to have an additional server, proxy calls to it, and verify that we can get stuff from it. There might be better options but this one seemed sound. |
This commit adds support to proxy backend. Proxy confguration would support all the configuration mentioned at https://webpack.github.io/docs/webpack-dev-server.html#proxy except transforamtions done using functions. Configuration should be added to a json file and file name(relative to project root) should be passed as an argument to ng serve commnad e.g `ng serve --proxy-config proxy.config.json`
@filipesilva @TheLarkInn I have added two test cases, open for your review. |
Need to update branch and tests will run again. |
@TheLarkInn Updated, all tests passed. |
FWIW I agree about removing the proxy and insecure proxy options. They're pretty limited and are just adding to command line option overload. |
@filipesilva @TheLarkInn One of the travis CI run appears to be a flaky. |
@TheLarkInn can you review? |
LGTM pending tests. |
Thanks @TheLarkInn @filipesilva. All tests passed now. |
@mmrath could you supply a bit of documentation for the readme? I've never worked with this and it's a bit confusing. |
@yesman85 there is some documentation in the wiki: https://github.com/angular/angular-cli/wiki/stories-proxy |
@filipesilva I am having issues with my proxy.config it works locally. However, when I deploy the application to dev environment the backend api call fails with a 404. Here is my proxy.config.json: "/rest/": { package.json: Please advice |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Issue #889
@filipesilva @TheLarkInn Here is the implementation for further discussion. I don't think it is merge ready. Please let me know your feedback on the implementation.
Also need your help on the testing side. How do I approach testing? Any existing test cases I can refer to?