Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda