【问题标题】:I'm having trouble setting up my angular netcore 2.1 webapplication properly in Godaddy我无法在 Godaddy 中正确设置我的 angular net core 2.1 Web 应用程序
【发布时间】:2019-04-12 09:42:38
【问题描述】:

我使用 Visual Studio FTP 配置文件将我的 netcore 2.1 Angular 应用程序部署到 Godaddy 主机。

部署的内容包括:

ClientApp folder
wwwroot
appsettings.json
application.dlls
web.config

ClientApp 中有一个 dist 文件夹,其中包含 glyph-icons 和 index.html。

我对托管服务器如何启动网页还很陌生,但我相当确定 root public_html 正在寻找它似乎无法访问的 index.html。

我尝试将 dist 文件夹中的内容复制到服务器上的 public_html 并且它启动应用程序似乎很好,但是我从控制器检索数据不起作用,找不到 404 api 路径。

【问题讨论】:

  • 欢迎来到 SO。当你构建一个 Angular 应用程序时,你会得到一个 index.html 文件,它是整个应用程序的基础。不确定 Godaddy 主机是如何工作的,但是在托管 Angular 应用程序时(对于一般的 SPA),您通常需要提供 index.html 作为索引(主 html)文件和错误文件(因此而不是返回404,服务实际上为您的应用提供了处理导航路线的机会)。

标签: angular web-deployment


【解决方案1】:

这通常是由于未呈现 dotnet 部分。看看这个Deploy and host .net core 2.0 and angular 6 app

还有https://www.google.com/amp/dotnetdetail.net/how-to-deploy-angular-6-and-asp-net-core-application-in-iis-8/amp/

这将向您展示文件结构的外观。希望这可以帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-27
    • 2021-07-20
    • 2019-03-29
    • 2023-03-06
    • 2019-09-25
    • 2020-06-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多