A
A
Alex2021-04-10 18:51:59
AJAX
Alex, 2021-04-10 18:51:59

How to make an ajax request from React to a local OpenServer?

Hello. Please tell me how to make a request from a React application.
I have a simple application created with create react app.
I wrote the simplest server in pure php, and made requests to it from a regular site (in the same OpenServer)
But how to make a request from React to OpenServer?
I found in Google that there are fake api packages for react, for example express or json-server, but they are still too tricky for me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-04-10
@firedragon

A local server is no different from an external one. Just enter his address. Set up CORS in your API

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question