Back-end and fron-end communication

Asked

Viewed 2,793 times

0

I am learning Reactjs, I made on the front end a simple screen of registration and I made the back end generating Ips with Nodejs, following this tutorial: https://jsao.io/2018/03/creating-a-rest-api-with-node-js-and-oracle-database/

Now I need to know how I communicate between my back end and my front end ?

Since they are in separate projects(I made the front in one folder, back in another)

  • 6
  • You have to post your codes, to see exactly how to solve your problem.

  • @Jonathandetoni can be git ? https://github.com/VeronicaEms/apiRest This is all my backend with Apis.

  • 1

    Describing the general problem you will get only a general answer. Example: "How to build a house?" , "Use blocks and cement, build solid walls". Instead ask something specific and responsive in a useful way: "How to lift a wall using this type of block with such a slope and such height safely?" , answer: "Position the blocks in such format, run this block placement algorithm, do not use this tool because there is such a risk, here is an example running from a wall ready for you to see how it does [link]". See? Too many wide questions don’t help.

  • There are several libs/frameworks for this, you can start by taking a look at Axios: > http://codeheaven.io/how-to-use-axios-as-your-http-client-pt/ check the item "Using Next in Browser", if you are not using something like Vue/React

  • @Verônicaemschermann, is missing the front u.u

  • The link @Andersoncarloswoss explains what is the minimum necessary for those who will work with WEB, not only website, but any application that communicates, many programs become bad because people do not understand the least of this and end up getting lost in the way. To create the Rest vc has to have a local server or a server hosted on the web (in the end it will be hosted) to serve the data, this is server-side, where you will find your web-API (Rest)

Show 2 more comments

2 answers

-1

Since you are using React on the front end, you can use Axios to make a request for your API and receive JSON with the data and run it in the UI, as well as you can make POST methods to send data to your API that you should enter into the database.

This link can help you -> click here

-2

Hello, you should read in REST, because for you to forward the requests that the front will conceive to the user for the back it is necessary to use the HTTP protocol. Read the following article (small, but demonstrates what REST is):

https://becode.com.br/o-que-e-api-rest-e-restful/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.