Timeline for How to proxy API requests to another server?
Current License: CC BY-SA 4.0
34 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 6, 2022 at 10:10 | history | edited | glenatron | CC BY-SA 4.0 |
Added a link to the answer below which documents the approach recommended in the Angular documentation.
|
Nov 19, 2021 at 12:49 | comment | added | Vũ Ngô |
This is now in the official Angular documentation: angular.io/guide/build#proxying-to-a-backend-server. Follow the official tutorial so we can do ng serve without extra parameters
|
|
Jun 11, 2021 at 7:57 | comment | added | Imal Hasaranga Perera | Guys this is not for production! this is a quick way you can forward your requests to the dev or staging based on the config.. you need to have set up reverse proxies within the actual server which the code is going to deploy | |
Jun 10, 2021 at 7:00 | comment | added | Asif | @imalhasarangaperera how to setup reverse proxy? | |
Jun 10, 2021 at 6:59 | comment | added | Asif | @imalhasarangaperera how proxy will work for production environment? please guide me. what step I should follow to make it work on production? | |
Jul 27, 2020 at 6:17 | comment | added | Imal Hasaranga Perera | @Avishek this is not for production at all! you should not even try to get this to work in production. in production environment make sure that you have set up a server-level reverse proxy | |
Jul 22, 2020 at 14:04 | comment | added | avishekdr |
I've done the same thing but when I do ng build --prod , it is not working probably because proxy.conf doesn't gets added in dist folder. So what to do while production build
|
|
Sep 10, 2019 at 11:50 | comment | added | ktsangop |
I would be grateful if someone could point to any documentation stating that the target key accepts an Object and not a String value. Angular and Webpack docs only show String as an accepted value.
|
|
Aug 8, 2019 at 17:56 | comment | added | Justin | Is there a way to add a single context that proxies all requests? It's annoying to have to add every single route that goes to the backend server. | |
May 10, 2019 at 17:11 | history | edited | RJFalconer | CC BY-SA 4.0 |
Re-order so update is first
|
Sep 24, 2018 at 11:46 | history | edited | splash | CC BY-SA 4.0 |
fixed typo
|
Jul 11, 2018 at 11:22 | comment | added | Imal Hasaranga Perera | yes that is basic idea here, so as the ip address and the port is accessible from your local computer proxy should work fine | |
Jul 11, 2018 at 11:11 | comment | added | fariba.j | @imalhasarangaperera can I use an IP from a different network for the proxy target? | |
S Dec 26, 2017 at 11:07 | history | suggested | SilverNak | CC BY-SA 3.0 |
improve formatting
|
Dec 26, 2017 at 9:57 | review | Suggested edits | |||
S Dec 26, 2017 at 11:07 | |||||
Aug 19, 2017 at 2:17 | comment | added | leoxs | It's possible to make it work in productive environment using node express? | |
Aug 15, 2017 at 11:23 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
deleted 1 character in body
|
Aug 13, 2017 at 14:51 | comment | added | rjdkolb | there is a stray comma "logLevel": "info", should be "logLevel": "info" (without the comma) | |
Jul 17, 2017 at 5:59 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
added 298 characters in body
|
Jul 17, 2017 at 5:46 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
deleted 154 characters in body
|
Jul 17, 2017 at 4:34 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
better description and more info
|
Jul 14, 2017 at 7:12 | comment | added | Imal Hasaranga Perera | There are many other ways yout can do this, please refer to documentation github.com/angular/angular-cli/blob/master/docs/documentation/… | |
Jul 10, 2017 at 21:57 | comment | added | JuanPablo | Here is the documentation: github.com/angular/angular-cli/wiki/stories-proxy | |
Jul 10, 2017 at 0:06 | vote | accept | elwyn | ||
May 18, 2017 at 16:53 | comment | added | iCode |
This works for me sometimes. But not always with current angular-cli version: 1.0.2. Problem is it connects to server and gets JSON responds. Then in chrome network console if we check, along with JSN data, it adds extra string. {"name":"something","id":"12sde"}Error occured while trying to proxy to: localhost:4200/api/v1/login . Any idea why it's happening? And not always. Detailed question here - stackoverflow.com/questions/44006326/…
|
|
May 18, 2017 at 6:46 | comment | added | heldt | where is the documentation for proxy.conf.json? | |
Mar 24, 2017 at 5:48 | comment | added | Imal Hasaranga Perera | can you share the proxy.conf.json of yours so I can have a look ? | |
Mar 23, 2017 at 21:57 | comment | added | ocespedes |
This works for me but the with the proxy ends up being something like /api/api/person any idea why is this happening?
|
|
Oct 31, 2016 at 9:55 | comment | added | Imal Hasaranga Perera | having "secure":false should do, it should be a boolean not a string... i spent countless time by keeping it "false" | |
Oct 31, 2016 at 9:41 | comment | added | nicowernli | How do you do with "unsafe" credentials. Using node I can set the process.env.NODE_TLS_REJECT_UNAUTHORIZED to 0 and will by pass that security, but I don't know how to do it with the proxy.config.json. This is all development stack, I don' t mind if it feels insecure | |
Sep 27, 2016 at 5:23 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
added 12 characters in body
|
Sep 27, 2016 at 4:19 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
added 1 character in body
|
Sep 27, 2016 at 4:10 | history | edited | Imal Hasaranga Perera | CC BY-SA 3.0 |
added 69 characters in body
|
Sep 27, 2016 at 4:05 | history | answered | Imal Hasaranga Perera | CC BY-SA 3.0 |