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

152
Views
Node server with express - Inject dynamic html into index.html using res.send({})

I have a dummy node js server with express and I am exposing a dummy Index.html on which I have a simple form like:

<form action="/results" method="post" enctype="multipart/form-data">
          <input type="text" name="username" placeholder="Full Name" />
          <input type="text" name="email" placeholder="Email" />
          <input type="file" name="picture" />
          <input type="submit" name="submit"value="picture" />
        </form>

When the form is submitted and I'm doing the post:

app.post("/results"), function (req, res, next) { }

instead of doing the classic res.send() :

res.send(`
some html with updated data 
`)

I just want to update/inject in Index.html elements dynamically without creating a new html template and add something like Hi <span>${req.body.username}</span> <i>your profile image was updated</i>

Is that possible ?

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

0

If you want to pass parameters to your template you have multiple options, see this post for instance : https://stackoverflow.com/a/46722250/16956436

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!