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

544
Vistas
Nodejs fails to show output on the cmd

I'm new to nodejs, All I'm trying to do is running a simple nodejs file on windows console Here's what I'm doing :

const http = require('http');
const host = '127.0.0.1';
const port = 3000;
const server = http.createServer(function(request, response) {
  response.writeHead(200, {
    'Content-Type': 'text/html'
  });
  response.end('Hello world');
}).listen(port, host);

server.on('connect', function(req) {
  console.log(req.url);
  console.log('Connected!');
})

server.on('error', function(e) {
  console.log(e);
})

The file is stored on D:\nodjs\test directory when I navigate to this directory and run the node hello.js command I'm expecting to see outputs ( response ) on the console. However this is not happening, it just show a blank response, I wonder if it takes too long to load or anything else might be related with my client/port setup ?

Here's a screenshot showing the case

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