Setting index.html as default page in asp.net core

后端 未结 8 651
北荒
北荒 2020-12-30 19:17

How can I get asp.net core to serve an index.html file from inside my wwwroot?

The reason I want to do this is because I an developing an angular 4 app using the ang

8条回答
  •  自闭症患者
    2020-12-30 19:58

    Just use this in startup.cs:

    app.UseFileServer();
    

    It's shorthand for:

    app.UseDefaultFiles();
    app.UseStaticFiles();
    

    it avoids issues with having to have those in the correct order (as shown above)

提交回复
热议问题