1

我有一个 Angular2 应用程序,它在具有 jit 和 aot 编译的 lite 服务器上本地运行。

对于 aot,我遵循了https://angular.io/docs/ts/latest/cookbook/aot-compiler.html上的教程。现在我想在 apache 服务器上托管应用程序。但是,我的项目中似乎存在一些配置问题。我有已编译的 aot 文件夹,其中包含子文件夹 node_moduels 和 app + dist/build.js。到目前为止,一切都很好。我认为将文件夹 aot + dist 和文件 index.html(在教程中引用 build.js)+ styles.css 复制到 apache 服务器应该可以。但是,这会在运行应用程序时导致错误的引用。

对于 index.html 中引用的所有文件,我得到 404,例如: http://apacheserverurl/dist/build.js

当我在浏览器中手动打开 index.html 时,也会出现同样的问题。因为我编译了所有的 javascript 和 html 文件,这不应该工作吗?

任何帮助深表感谢。

4

0 回答 0