diff --git a/AuthorizationServer/AuthorizationServer.csproj b/AuthorizationServer/AuthorizationServer.csproj index f26a38e..f46c213 100644 --- a/AuthorizationServer/AuthorizationServer.csproj +++ b/AuthorizationServer/AuthorizationServer.csproj @@ -1,7 +1,9 @@ - netcoreapp2.0 + net8.0 + enable + enable 1.0 @@ -17,13 +19,7 @@ - - - - - - - + diff --git a/AuthorizationServer/Startup.cs b/AuthorizationServer/Startup.cs index 22ba409..3d70917 100644 --- a/AuthorizationServer/Startup.cs +++ b/AuthorizationServer/Startup.cs @@ -20,6 +20,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Authlete.Api; using Authlete.Conf; @@ -42,7 +43,7 @@ public void ConfigureServices(IServiceCollection services) // AddWebApiConventions() is added by WebApiCompatShim. // Calling the method enables Web API implementations // to return an HttpResponseMessage instance directly. - services.AddMvc().AddWebApiConventions(); + services.AddControllers(); // Register an instance of IAuthleteApi so controllers // can refer to it in order to call Authlete Web APIs. @@ -57,7 +58,7 @@ public void ConfigureServices(IServiceCollection services) } - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { @@ -66,7 +67,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) app.UseDefaultFiles(); app.UseStaticFiles(); - app.UseMvc(); + + // Updated to use routing + app.UseRouting(); + + // Configure endpoints for controllers + app.UseEndpoints(endpoints => + { + // Ensure this matches your app's routing needs + endpoints.MapControllers(); + }); }