Skip to content

Faced issues with API calls during Development #13

@BattleOfPlassey

Description

@BattleOfPlassey

To tell the React development server to proxy any unknown requests to your node API server in development, you can add a proxy field to your client package.json, for example:

"proxy": "http://localhost:5000"

which will redirect all traffic to node API and not REACT Development URL.

This way, when you fetch('/api/articles') in development, the development server will recognize that it’s not a static asset, and will proxy your request to http://localhost:5000/api/articles as a fallback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions