Running node.js code just displays a node identifier

前端 未结 9 2183
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-19 19:07

I have the following code in a file called server.js.

var http = require(\'http\');

http.createServer(function (request, response) {
  response.writeHead(200,          


        
9条回答
  •  忘了有多久
    2021-02-19 19:43

    I used the node.js command prompt, instead of the windows default command prompt and it worked for me. Did not know why it did't work in the windows default command prompt.

提交回复
热议问题