所以我想了解如何使用 node.js 模块“http”http.createServer() 我想知道是否有可能看到这个函数是如何定义的?我可以找到定义的内容吗?我找不到它
最佳答案
Node.js source code is available on Github .对于 API 的 JavaScript 端,请查看 lib
目录。
https://github.com/joyent/node/blob/master/lib/http.js#L61
exports.createServer = function(requestListener) {
return new Server(requestListener);
};
关于node.js http 模块 http.createServer 是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26454883/