Proxy not working when running ng serve

See original GitHub issue

OS?

Mac OSX (Sierra)

Versions.

@angular/cli: 1.0.0-beta.31 node --version v6.9.1

Repro steps.

Need to run a proxy so I added --proxy-config proxy.conf.json in package.json This works if I run npm start but then I cant access the site from my mobile on the same network. If I run ng serve then I can use my mobile to test the site but the proxy stopps working… ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:24 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
martinmcwhortercommented, Feb 13, 2017

Did you try

ng serve --proxy-conf proxy.conf.json

?

2reactions
nikithaperuka89commented, Mar 21, 2019

@kultigin trying add the below to avoid ECONNRESET error { “/emport-api/*”: { “target”: “http://localhost:8080”, “secure”: false, “logLevel”: “debug”, “changeOrigin”: true, “headers”: { “Connection”: “keep-alive” } } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular-CLI proxy to backend doesn't work - Stack Overflow
Angular 4 running localhost: http://localhost:4200/. In package.json. "start": "ng serve --proxy-config proxy.config.json",.
Read more >
Angular proxy to backend is not working - Morioh
Angular uses webpack dev server to serve the app in development mode. If we look at the following diagram, app UI is running...
Read more >
Use a Proxy with the Angular CLI to Fix CORS ... - Sam Julien
When we first try to use a local server in development, we get a rude CORS error in the console and nothing works....
Read more >
How to resolve CORS errors by using Angular Proxy?
“ logLevel" is used to check whether proxy is working or not. ... Finally, you have to restart your project with the ng...
Read more >
Angular CLI Proxy Settings for API Calls | by GID Master
Keep in mind that Angular CLI uses this setting during development stage only, it means that the proxy configuration works when running the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found