search

Home  >  Q&A  >  body text

Connecting the Node.Js Express backend to the React frontend

I want to merge two projects: one for React frontend and another for NodeJs Express backend. I'm using Android Studio to preview my front-end application on the mobile emulator. I'm not sure if you have any ideas on how to make everything work together.

I first copied the frontend project and placed it in the root directory of the backend project. I then set a variable in the package.json file to be able to start the frontend from the backend ("client": "cd my_frontend_project && npm start"). As for next steps, I'm lost and I really don't know what to do. Should I create one file to initiate this connection or multiple files since I know my project contains multiple pages/functions and how do I set up this connection?

P粉310931198P粉310931198277 days ago468

reply all(1)I'll reply

  • P粉330232096

    P粉3302320962024-04-02 00:23:58

    1. First you need to start the backend, if the backend is not implemented, you should implement Cors, (this is a middleware)
    2. You need to use postman to test the API
    3. Finish

    reply
    0
  • Cancelreply