Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
Get data back from server to front-end

Hi I'm building a video uploader and right now I can upload video from my front-end (React.js) to my back-end public folder (Node.js) using POST method (ajax). I was wondering how to now send it back to the front-end and get the videos to play. Thought of doing a GET method route of my back-end, could that work? (Have to say I'm a bit confused on this part since I'm only used to doing HTTP request from front to back...)

Would much appreciate any good advice to point me to the right direction. Thanks!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you're saving the uploaded videos to a folder on your server, you could add something like this to your app:

app.get(__dirname + '/uploads/:vid', function(req, res){
res.sendFile(req.url);
});

Then you would simply send a regular GET request from your front-end to the path of the video (which will trigger the above function) and you should get the requested video in the response.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!