在localhost下的应用程序中托管angular 2应用程序

时间:2017-01-01 12:35:11

标签: angular iis

我是一个初学者角色2,并根据我发现的例子开始研究项目。在Windows上托管我的应用程序时,它可以在http:/ localhost(或使用npm http://localhost:3000)访问,但如果我尝试将它放在IIS下的IIS上,MyApp仍然会尝试在localhost下导航。

你可以找到我用过的示例代码: https://github.com/DeborahK/Angular2-GettingStarted/tree/master/APM%20-%20Final

有没有简单的方法呢?enter image description here

1 个答案:

答案 0 :(得分:2)

试试这个:在angular.html应用的index.html中,修改<base href="/MyApp/">