Skip to content
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

proxy-config documentation #1896

Closed
wants to merge 6 commits into from
Closed

proxy-config documentation #1896

wants to merge 6 commits into from

Conversation

leon
Copy link
Contributor

@leon leon commented Aug 30, 2016

documentation on how to use --proxy-config

@googlebot
Copy link

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@leon
Copy link
Contributor Author

leon commented Aug 30, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@mmrath
Copy link
Contributor

mmrath commented Aug 30, 2016

I think it is worth mentioning that proxy confguration would support all the configuration mentioned at https://webpack.github.io/docs/webpack-dev-server.html#proxy except support for functions in configuration.

Good work @leon

@leon
Copy link
Contributor Author

leon commented Aug 31, 2016

@mmrath I've added the link :)

@jasonswett
Copy link

The config file in these instructions actually didn't work for me. What did work for me was something slightly different:

{
  "/api": {
    "target": "http://localhost:3000",
    "secure": "false"
  }
}

(/api instead of api/*)

@leon
Copy link
Contributor Author

leon commented Sep 12, 2016

@jasonswett We can change it to /api it works for me too, and is easier to understand.

@gonzofish
Copy link

Thanks for getting this doc out there! Helped me out big time.

@filipesilva
Copy link
Contributor

Thanks for documenting this feature, we'll merge this soon!

We do this by passing a file to `--proxy-config`

Say we have a server running on `http://localhost:3000/api` and we want all calls th `http://localhost:4200/api` to go to that server.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

th = to.

Thanks for the documentation!

@gus4no
Copy link

gus4no commented Sep 27, 2016

Any idea on how to have different targets per environment?

JJayet pushed a commit to JJayet/angular-cli that referenced this pull request Oct 2, 2016
deebloo pushed a commit to deebloo/angular-cli that referenced this pull request Oct 3, 2016
@gonzofish
Copy link

@gus4no you could have different NPM tasks which call ng serve --proxy proxies/dev.config.json in dev or ng serve --proxy proxies/integration.config.json or whatever

not an automated solution, but something...

@maximelafarie
Copy link

Always nothing about --proxy option in official documentation ?

@filipesilva
Copy link
Contributor

@maximelafarie it's in the wiki now: https://github.com/angular/angular-cli/wiki/stories-proxy

@stockmind
Copy link
Contributor

It could seems silly but a note/remind like "After every edit to proxy.config.json a restart of npm process is needed to apply them" could save some time in late hour working! 😄

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants