@@ -24,16 +24,12 @@ namespace NetCoreBBS
24
24
{
25
25
public class Startup
26
26
{
27
- public Startup ( IHostingEnvironment env )
27
+ public Startup ( IConfiguration configuration )
28
28
{
29
- var builder = new ConfigurationBuilder ( )
30
- . SetBasePath ( env . ContentRootPath )
31
- . AddJsonFile ( "appsettings.json" , optional : true , reloadOnChange : true )
32
- . AddEnvironmentVariables ( ) ;
33
- Configuration = builder . Build ( ) ;
29
+ Configuration = configuration ;
34
30
}
35
31
36
- public IConfigurationRoot Configuration { get ; }
32
+ public IConfiguration Configuration { get ; }
37
33
38
34
// This method gets called by the runtime. Use this method to add services to the container.
39
35
public void ConfigureServices ( IServiceCollection services )
@@ -47,7 +43,9 @@ public void ConfigureServices(IServiceCollection services)
47
43
} ;
48
44
} ) . AddEntityFrameworkStores < DataContext > ( ) . AddDefaultTokenProviders ( ) ;
49
45
// Add framework services.
50
- services . AddMvc ( ) ;
46
+ services . AddMvc ( option=> {
47
+ option . EnableEndpointRouting = false ;
48
+ } ) ;
51
49
services . AddScoped < IRepository < TopicNode > , Repository < TopicNode > > ( ) ;
52
50
services . AddScoped < ITopicRepository , TopicRepository > ( ) ;
53
51
services . AddScoped < ITopicReplyRepository , TopicReplyRepository > ( ) ;
@@ -71,7 +69,7 @@ public void ConfigureServices(IServiceCollection services)
71
69
}
72
70
73
71
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
74
- public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory )
72
+ public void Configure ( IApplicationBuilder app , IWebHostEnvironment env , ILoggerFactory loggerFactory )
75
73
{
76
74
app . UseRequestIPMiddleware ( ) ;
77
75
0 commit comments