Enable CORS in my React App with Node.js backend

后端 未结 3 795
借酒劲吻你
借酒劲吻你 2021-01-05 14:17

I used create-react-app to build my react app. This app does a POST call on another API (elasticsearch), hosted on a different server (not owned/managed by me). So once the

3条回答
  •  逝去的感伤
    2021-01-05 14:52

    You should add that to the file where you configure the server you are using. If you were using express you would add that to the server.js file you are talking about but it seems you have an elasticsearch server and a react app so you do not have a node.js backend.

    You probably will have to include a cors configuration in the elasticsearch server.

提交回复
热议问题