U
U
Umid2016-10-24 14:07:10
Node.js
Umid, 2016-10-24 14:07:10

Can't start http server on node js?

The code:

var http = require('http');

var server = new http.Server();

server.listen(1337, '127.0.0.1');

server.on('require', function(req, res) {
  res.end("Привет Мир!");
});

console.log('Успешный запуск');

What the console outputs:
7b21c3faa6c048538520c03168411d52.png
And nothing is displayed in the browser at 127.0.0.1:1337.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question