33
44using Microsoft . AspNetCore . Builder ;
55using Microsoft . AspNetCore . Hosting ;
6- using Microsoft . AspNetCore . Mvc ;
76using Microsoft . Bot . Builder ;
87using Microsoft . Bot . Builder . Integration . AspNet . Core ;
98using Microsoft . Extensions . Configuration ;
109using Microsoft . Extensions . DependencyInjection ;
10+ using Microsoft . Extensions . Hosting ;
1111using Microsoft . PowerVirtualAgents . Samples . RelayBotSample . Bots ;
1212
1313namespace Microsoft . PowerVirtualAgents . Samples . RelayBotSample
@@ -24,7 +24,7 @@ public Startup(IConfiguration configuration)
2424 // This method gets called by the runtime. Use this method to add services to the container.
2525 public void ConfigureServices ( IServiceCollection services )
2626 {
27- services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_1 ) ;
27+ services . AddControllers ( ) ;
2828
2929 // Create the Bot Framework Adapter with error handling enabled.
3030 services . AddSingleton < IBotFrameworkHttpAdapter , AdapterWithErrorHandler > ( ) ;
@@ -44,7 +44,7 @@ public void ConfigureServices(IServiceCollection services)
4444 }
4545
4646 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
47- public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
47+ public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
4848 {
4949 if ( env . IsDevelopment ( ) )
5050 {
@@ -55,10 +55,19 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
5555 app . UseHsts ( ) ;
5656 }
5757
58+ // app.UseHttpsRedirection();
59+
5860 app . UseDefaultFiles ( ) ;
5961 app . UseStaticFiles ( ) ;
6062
61- app . UseMvc ( ) ;
63+ app . UseRouting ( ) ;
64+
65+ app . UseAuthorization ( ) ;
66+
67+ app . UseEndpoints ( endpoints =>
68+ {
69+ endpoints . MapControllers ( ) ;
70+ } ) ;
6271 }
6372 }
6473}
0 commit comments