Tagged: proxy ng server npm run
- This topic has 5 replies, 3 voices, and was last updated 6 years, 11 months ago by mmargozzi.
-
AuthorPosts
-
mmargozziParticipantAfter reading the below article, I wanted to set up a proxy so I can redirect REST calls to a backend not running locally on my dev box. It is true that ng serve seems to ignore the –proxy-config.
From a command line I ran npm run and it does work. How can I configure the IDE to work with the proxy?
It seems like if I could tell it to start with npm start rather than ng serve it might work.I was unable to find a related posting here. Surely someone has already solved this issue.
support-swapnaModeratormmargozzi,
Apologies for the delayed reply. I have escalated this query to the dev team. They will get back to you soon.
–Swapna
MyEclipse Support
Brian FernandesModeratormmargozzi,
What we do is convert the settings on the Eclipse proxy preference page (Window > Preferences > General > Network Connections) into NPM proxy settings in memory. The npm calls are then proxied through these settings.
This applies to all npm commands executed from within the IDE. Can you try adding your proxy settings there & let us know if it works?
mmargozziParticipantWell, I tried my best to follow your suggestion. Here is what I did. it seems to have NO effect.
See attachment.Attachments:
You must be logged in to view attached files.
Brian FernandesModeratorI think I may have misunderstood what you were trying to do, apologies.
Bring up the context menu on your application in the Servers view and choose Properties (see attached screenshot). In the resulting dialog, there’s an area that allows you to specify custom
ng serve
command arguments. I guess you could add the--proxy-config
switch there, pointing to the right configuration?Attachments:
You must be logged in to view attached files.
mmargozziParticipantOK, this is what I was looking for and it worked. Thank you!
-
AuthorPosts