Node.js http.createServer how to get error

后端 未结 4 513
广开言路
广开言路 2020-12-16 13:31

I am new to node.js and am trying to experiment with basic stuff.

My code is this

var http = require(\"http\");
http.createServer(function(request,          


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 14:06

    Print stacktrace of uncaught exceptions using following code.

    process.on('uncaughtException', function( err ) {
                console.error(err.stack);
     });
    

提交回复
热议问题