我最近使用了github的angular种子文件夹来开发angular应用程序.在之前的angularjs教程中,有一个脚本文件夹和一个服务器.angular seed文件夹中的js文件,其中包含运行 node 服务器的所有配置.那么npm现在是如何开始运行 node 服务器的呢? node 服务器的所有配置都在哪里?
我最近使用了github的angular种子文件夹来开发angular应用程序.在之前的angularjs教程中,有一个脚本文件夹和一个服务器.angular seed文件夹中的js文件,其中包含运行 node 服务器的所有配置.那么npm现在是如何开始运行 node 服务器的呢? node 服务器的所有配置都在哪里?
如果你看package.json
个文件.
你会看到这样的东西
"start": "http-server -a localhost -p 8000"
这说明在端口8000
的localhost
地址启动http-server
http-server是一个 node 模块.
Update:-包括@Usman的 comments ,理想情况下它应该出现在你的package.json
条 comments 中,但如果它不存在,你可以将其包含在scripts
条 comments 中.