DEV Community

NardjesBen
NardjesBen

Posted on

Combine React js with Node Js ?

I am a beginner and I would like to make an application with :

Front-end : React js
Back-end : Node js

my interface will contain 2 buttons : Download and Send, I would like to download csv files from a sftp server and when we click on download files will be displayed in the interface and the send button allows to send files from my local machine to the sftp server.

How can I combine the react and node part, I was able to connect and upload files in nodejs but I don't know how to combine that with React?

Discussion (9)

Collapse
kamalhossain profile image
Kamal Hossain

Hey there, did you created the nodejs and react part separately?

Collapse
nardjes profile image
NardjesBen Author

Yes, i do that

Collapse
kamalhossain profile image
Kamal Hossain

Create two route at nodejs ,

One GET route for download , another POST route for upload the files from frontend.
Use "axios" at frontend to consume those API or endpoints.

Thread Thread
nardjes profile image
NardjesBen Author

thank you for your answer it will help me

Thread Thread
icecoffee profile image
Atulit Anand

But you do need to configure web pack right. Or is there any boiler plate you know of.

Thread Thread
nardjes profile image
NardjesBen Author

No, I'm just a new and I don't know where to start

Thread Thread
icecoffee profile image
Atulit Anand

Ditto my friend this question have been on my mind since forever.

Collapse
ps173 profile image
Pratham Sharma • Edited on

So well firstly create client folder and add your react front end there.. then to server folder add backend code. And that's how you get started. Everything else depends on app.

Collapse
nardjes profile image
NardjesBen Author

OK, thank you for your answer.