如果后端是Windows服务(Windows Server 2016),则在哪里托管Angular脚本?

时间:2018-09-25 15:34:20

标签: .net angular core

我在Windows Service 2016中将.NET Core API自托管为Windows服务。另一方面,我有与此API一起使用的Angular 6项目。如何在服务器上托管Angular脚本?

以前,我在IIS服务器中托管了一个空HTML页面,其中包含脚本,但是现在无法使用IIS。

1 个答案:

答案 0 :(得分:0)

正如丹尼尔所说,您唯一要做的就是拥有一个像startp.cs的

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
    }
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        app.UseDefaultFiles();
        app.UseStaticFiles();
    }
}

然后将文件(index.html,bundles -.js-和资产文件夹)放在wwwroot文件夹下