node.js - 在 Node.js 中部署 angularjs 应用程序

标签 node.js angularjs

您好,我正在关注 this tutorial来自 AngularJS 文档。

我正在尝试使用这种方法来学习它。

You will need an http server running on your system. Mac and Linux machines typically have Apache pre-installed, but If you don't already have one installed, you can use node to run scripts/web-server.js, a simple bundled http server.

我的服务器已启动,但在 localhost:8000(它运行的端口)上发生的唯一事情是文件被列出。

如何使用 Node.js 进行部署?

当我在浏览器中导航到 localhost:8000 时,这是我的服务器日志。

112-108-15:scripts phe$ ./web-server.js
Http Server running at http://localhost:8000/
GET / Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36
GET / Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36

最佳答案

如你所见the instruction ,你需要运行

node ./scripts/web-server.js

然后转到 http://localhost:8000/app/index.html

关于node.js - 在 Node.js 中部署 angularjs 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18746834/

相关文章:

node.js - 如何在ubuntu机器上安装ursa

javascript - 使用 moment.js 按 'last month' 和 'last week' 过滤点击时的对象数组

javascript - 获取 Rss feed ionic 2 时出现问题

javascript - 如何使用 Angular 的 ng-style 从 JSON 文件获取数据

javascript - React Router/Express - 刷新动态 URL 参数

node.js - Node.js 中带有回调的循环

node.js - 在 Mongoose 中跨整个应用程序共享数据库连接

javascript - 使用 Javascript 迭代在 Html 中显示多个图像

javascript - Angular - 在没有 `$digest` 的情况下运行 `$scope`

node.js - 分配回对象时日期格式未更新 (YYYYMMDD)