Home > other >  Nodejs try to create the WEB server cannot access localhost
Nodejs try to create the WEB server cannot access localhost

Time:09-24

var http=require('http');

HTTP. CreateServer (function (the req, res) {

Res. WriteHead (200, {' the content-type: 'text/plain'})
Res. The end (' link to my server ')

}), listen (8888)

The console. The log (' Server has located ')

CodePudding user response:

Code is no problem, I have tried it on, if your IP address and port number input error,

CodePudding user response:

The code is no problem

CodePudding user response:

Don't use localhost, 2nd floor with native gateway address, and I also is the problem, colleagues will be fine, hope technology talent to solve it,

CodePudding user response:

Local can try to see ping first, and then can't change the port to try next, I test in general use is 8000,
  • Related