diff --git a/JetHerald/JetHerald.csproj b/JetHerald/JetHerald.csproj index 967abd3..d76f51b 100644 --- a/JetHerald/JetHerald.csproj +++ b/JetHerald/JetHerald.csproj @@ -1,7 +1,7 @@ - netcoreapp2.1 + netcoreapp3.0 @@ -10,7 +10,6 @@ - diff --git a/JetHerald/Startup.cs b/JetHerald/Startup.cs index a55d832..ff904d5 100644 --- a/JetHerald/Startup.cs +++ b/JetHerald/Startup.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; namespace JetHerald { @@ -22,12 +23,12 @@ namespace JetHerald services.Configure(Configuration.GetSection("Telegram")); services.AddSingleton(); services.AddSingleton(); - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { var bot = app.ApplicationServices.GetService(); bot.Init().Wait(); @@ -36,8 +37,12 @@ namespace JetHerald { app.UseDeveloperExceptionPage(); } - - app.UseMvc(); + + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); } } }