Skip to content

Proxy to external API #482

@stinaq

Description

@stinaq

In the README there are instructions on how to set up a proxy for API requests in development. I have followed those instructions and it does not work as expected.

Any unrecognized request will be redirected to the specified proxy.

I have set up my proxy like so:

"proxy": "http://test.example.com/"

In the packaage.json and this eliminates the CORS error I get before I added the proxy config, but the request to the API is not working. In a component I am doing a fetch() to the address /api/recent.json which I would then expect to result in http://test.example.com/api/recent.json and I have tested that address and it works, but I get a 404 in the web console, saying http://localhost:3000/api/recent.json can't be found.

Am I missing something or should this not work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions