Skip to content

React Js making API calls in production build #10984

@pradeeshattlee

Description

@pradeeshattlee

Hi,
I am new to ReactJS I have created and processed React app in development mode allows for successful communication with my API by Proxying API Requests from package.json.

But when I create a production build for my React app and process it using serve -s build communication with my API is unsuccessful and fails while Proxying API Requests from package.json.

I have used AXIOS to make API calls

My question is, why isn't the API loading in production /build?

If proxying doesn't work in production build how should I make API calls?

When I try to give the full URL in the AXIOS CORS error occurs

Can someone point me in the right direction?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions