
之前搞不明白为何要使用 http.createServer(app)代替 app.listen,上网查询看到 app.listen 废弃了?
所以使用 http.createServer(app )是为什么呢
1 caopi OP ``` app.listen = function listen() { var server = http.createServer(this); return server.listen.apply(server, arguments); }; ``` 这段源码是什么意思呢 |
2 throns 2018 年 10 月 11 日 via Android 或许应该去看看 http.createServer().listen 函数的源码 |
4 imherer 2018 年 10 月 11 日 有废弃吗?你看的多少版本的? 我看官方 4.x 的文档都还在使用 app.listen 啊 |