From 087e7d63af5b0cd0c526b8f1639da01ce7991d18 Mon Sep 17 00:00:00 2001 From: meysam Date: Tue, 5 Mar 2024 11:45:38 +0400 Subject: [PATCH 1/2] Update target framework and remove unnecessary dependencies The target framework of the 'AuthorizationServer' project has been updated from 'netcoreapp2.0' to 'net8.0'. As a part of this update, several unnecessary package references have been removed and the 'Authlete.Authlete' package has been upgraded to version '1.5.0'. Additionally, 'ImplicitUsings' and 'Nullable' were also enabled. --- AuthorizationServer/AuthorizationServer.csproj | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 @@ - - - - - - - + From 89cb50cda8a10be31e554d3189ee0c74fed7ad39 Mon Sep 17 00:00:00 2001 From: meysam Date: Mon, 11 Mar 2024 11:46:44 +0400 Subject: [PATCH 2/2] Update server configurations and routing in Startup.cs The commit introduces Microsoft.Extensions.Hosting library into the AuthorizationServer's Startup.cs. It also replaces services.AddMvc().AddWebApiConventions() with services.AddControllers() and modifies the Configure method to accommodate these changes. Lastly, it updates the application's routing to use app.UseRouting() and configures endpoints specifically for controllers. --- AuthorizationServer/Startup.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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(); + }); }