asp.net Core 配置默认

app.UseFileServer(new FileServerOptions() {
                FileProvider = new PhysicalFileProvider(env.ContentRootPath),
                RequestPath = new PathString(""),
                EnableDefaultFiles = true,//启用默认文件
                EnableDirectoryBrowsing = false//关闭目录浏览
           });

 app.UseMvc(routes => {
                routes.MapRoute(
                   name: "default",
                   template: "{controller}/{action}/{id?}",
                    defaults: new { group = "core", app = "User", controller = "User", action = "index" });//默认打开路径

  

  

posted @ 2016-08-07 18:26  受气包  阅读(480)  评论(0编辑  收藏  举报