gpt4 book ai didi

node.js - 学习node.js/express.js : What's the deal with bin/www?

转载 作者:IT老高 更新时间:2023-10-28 22:02:40 26 4
gpt4 key购买 nike

我看过 express.js 的教程,例如 this它从他们自己的 app.js 文件从头开始,并放弃使用 express 生成器。

我的问题:对于试图掌握如何使用这些工具并制作基本 Web 应用程序的初学者,我应该关注 bin/www 还是应该只在 中定义端口>app.js?

我目前在 bin/www 中了解的唯一功能是设置端口。 express 生成器是否过于臃肿,边缘案例功能对初学者来说太过分了?

最佳答案

这就是原因,由一位特快的维护者简明扼要地说明:

So you can require('./app') from external files and get the express app that is not listening on any port (think unit tests and the like).

source

关于node.js - 学习node.js/express.js : What's the deal with bin/www?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36638123/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com