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

后端 未结 8 719
北荒
北荒 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:59

    I needed to declare UseDefaultFiles() before UseStaticFiles().

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

提交回复
热议问题