A
A
Andrey Neumyvanny2021-09-23 08:19:11
API
Andrey Neumyvanny, 2021-09-23 08:19:11

How to make an API on NEXT.JS + PHP?

Such situation. Previously, the project was written in PHP and Laravel. They didn't do any API. Now we make the front on Next and the back remains on PHP. Now we are trying to write an API, so far we have done a local api https://react-backend.lan:3000/api/ on the client, of course, the request cannot be made, how to do it right. Write an API with authorization, or is it possible to somehow first contact the Next server, execute the request locally and return a response. For example, such a case, you need to determine the location, I get the coordinates on the front, then I send them to the Next server, it makes a request to the local API and returns a response to the front, the same story with sending an application, for example.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question