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

257
Views
data sending from server to client-side Nodejs

I made a post request. I want to perform some operations and to send back data to the client-side based on which my frontend will change. How to do that??

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can simply get a response to the post request after you make the changes. If the changes take too much time and cause a timeout, There are two possible ways to proceed:

  1. Set a timeout in frontend and make a get request to fetch the data.
  2. Look into socket.io. (This is a better way of handling things as you can set a listener on frontend to receive any data from backend.)
about 4 years ago · Juan Pablo Isaza Report

0

In the server side you can write

var express = require('express');
var app = express();
app.listen('3000')

app.post("/getdata", (req, res) => {
    res.send(//any json data)
})

in your client side you can write

var output = false
fetch("your server link or if you are on local server then 
http://localhost:3000/getdata", {method: 'POST'})
.then(data => {return data.json()}).then(data => {output = data})

now you have your result in var output of your client side webpage

about 4 years ago · Juan Pablo Isaza 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!