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

265
Vistas
How do I pass a data from an HTML form to my Node.js file?

Hope you are well. I am currently new to this side of web-development, and was wondering how my HTML files communicate with the Node.js side of things.

So from my understanding, Node.js only runs from the command line through "node file.js" and my HTML files run on my browser, but how do they communicate?

I have a few promises on my Node.js file which get data from an API endpoint, but currently to test, I define the "ID" (which i send to the endpoint) in the Node.js manually, how do I let the HTML (user) do this? and vice versa, how do I pass the JSON data which i receive to the HTML side.

Im extremely sorry if i've asked the wrong question, quite new to this type of development. Thank you so much in advance :)

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

So from my understanding, Node.js only runs from the command line through "node file.js" and my HTML files run on my browser, but how do they communicate?

Most commonly, when you want Node.js and an HTML document to communicate you would write an HTTP server using Node.js (often with the Express.js framework) and then make HTTP requests (e.g. with a form submission or Ajax).

There are other options, such as Electron or OpenFin which are used for building desktop apps wrapped around HTML and Node.

about 4 years ago · Juan Pablo Isaza Denunciar

0

In Node.js you have the option to build a server with Express, you can look at the documentation and see how it works. in express, you will send REST API requests. you can send HTML files in the request to communicate with the client.

But if you want to serve static files such as images, CSS files, and JavaScript files, use the express static built-in middleware function in Express.

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