@@ -9,13 +9,13 @@ namespace Denifia.Stardew.SendItemsApi
99{
1010 public class Startup
1111 {
12- public Startup ( IHostingEnvironment env )
12+ public Startup ( IWebHostEnvironment env )
1313 {
1414 var builder = new ConfigurationBuilder ( )
15- . SetBasePath ( env . ContentRootPath )
16- . AddJsonFile ( "appsettings.json" , optional : false , reloadOnChange : true )
17- . AddJsonFile ( $ "appsettings.{ env . EnvironmentName } .json", optional : true )
18- . AddEnvironmentVariables ( ) ;
15+ . SetBasePath ( env . ContentRootPath ) ;
16+ // .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
17+ // .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
18+ // .AddEnvironmentVariables();
1919 Configuration = builder . Build ( ) ;
2020 }
2121
@@ -26,17 +26,21 @@ public void ConfigureServices(IServiceCollection services)
2626 {
2727 services . Configure < AzureStorageConfig > ( Configuration . GetSection ( "AzureStorage" ) ) ;
2828 services . AddScoped < ITableStorageRepository , AzureTableStorageRepository > ( ) ;
29- services . AddMvc ( ) ;
29+ services . AddControllers ( ) ;
3030 }
3131
3232 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
33- public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory )
33+ public void Configure ( IApplicationBuilder app , IWebHostEnvironment env , ILoggerFactory loggerFactory )
3434 {
35- loggerFactory . AddConsole ( Configuration . GetSection ( "Logging" ) ) ;
36- loggerFactory . AddDebug ( ) ;
35+ // loggerFactory.AddConsole(Configuration.GetSection("Logging"));
36+ // loggerFactory.AddDebug();
3737
38+ app . UseRouting ( ) ;
3839 app . UseStaticFiles ( ) ;
39- app . UseMvc ( ) ;
40+ app . UseEndpoints ( x =>
41+ {
42+ x . MapControllers ( ) ;
43+ } ) ;
4044 }
4145 }
4246}
0 commit comments