0

I am basically trying to run a dev Angular application so I can write and test services easier for our production NativeScript app.

It requires an external API and I have tried multiple ways to get around the CORS issue. Many references only state that I have to do the following:

{
  "/main-feed": {
  "target": "https://endpoint.org",
  "secure": true,
  "logLevel": "info",
  "changeOrigin": true
}

I have gotten this proxy to work with localhost but for an external api when I hit the final endpoint /main-feed/v1/items it gives me back an error that states:

GET http://localhost:4200/main-feed/v1/items 404 (Not Found)

I have tried /main-feed/ and /main-feed/*.

It would be really great if I could get this working but I understand if Angular is not built for this. I really wish it was easier for development to override CORS but I understand the risk.

1 Answer 1

1

What is the full URL of your back end point?

Did you try to set up a proxy config? If not please take a look at this link

PS: don't forget the port in your target

Sign up to request clarification or add additional context in comments.

1 Comment

I did but this is referencing an api that I do not control. I could setup a spring boot or some other backend but that is more effort than I want - ended up just going the nativescript only route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.