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

210
Views
Cómo usar la recarga en vivo en un servidor express

Así que estoy usando express para hacer un servidor:

 const express = require('express'); const app = express(); const PORT = 3000; app.use(express.static("public")); app.get('/', (req, res) => { res.sendFile('index.html'); }); app.listen(PORT, () => { console.log(`Server running on http://localhost:${PORT}`) });

El servidor funciona correctamente, sin embargo, necesito que se recargue en vivo cuando actualice el archivo HTML

¿Alguien puede ayudar?

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

0

npm install -g nodemon

luego agregue una línea de script a su paquete.json

 "live": "nodemon server.js"

ahora, cuando npm viva, se recargará en vivo

para obtener más detalles, consulte https://github.com/remy/nodemon

si también se necesita recargar la página en vivo

 npm install -g livereload livereload . -w 1000 -d

para obtener más detalles, consulte https://github.com/napcs/node-livereload

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!