2
2
using Microsoft . AspNetCore . Hosting ;
3
3
using Microsoft . Extensions . Configuration ;
4
4
using Microsoft . Extensions . DependencyInjection ;
5
- using Microsoft . Extensions . Logging ;
6
5
using WebApi . Helpers ;
7
6
using WebApi . Services ;
8
7
using Microsoft . IdentityModel . Tokens ;
9
8
using System . Text ;
10
9
using Microsoft . AspNetCore . Authentication . JwtBearer ;
10
+ using Microsoft . AspNetCore . Mvc ;
11
11
12
12
namespace WebApi
13
13
{
14
- public class Startup
14
+ public class Startup
15
15
{
16
16
public Startup ( IConfiguration configuration )
17
17
{
@@ -24,7 +24,7 @@ public Startup(IConfiguration configuration)
24
24
public void ConfigureServices ( IServiceCollection services )
25
25
{
26
26
services . AddCors ( ) ;
27
- services . AddMvc ( ) ;
27
+ services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
28
28
29
29
// configure strongly typed settings objects
30
30
var appSettingsSection = Configuration . GetSection ( "AppSettings" ) ;
@@ -56,17 +56,13 @@ public void ConfigureServices(IServiceCollection services)
56
56
}
57
57
58
58
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
59
- public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory )
59
+ public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
60
60
{
61
- loggerFactory . AddConsole ( Configuration . GetSection ( "Logging" ) ) ;
62
- loggerFactory . AddDebug ( ) ;
63
-
64
61
// global cors policy
65
62
app . UseCors ( x => x
66
63
. AllowAnyOrigin ( )
67
64
. AllowAnyMethod ( )
68
- . AllowAnyHeader ( )
69
- . AllowCredentials ( ) ) ;
65
+ . AllowAnyHeader ( ) ) ;
70
66
71
67
app . UseAuthentication ( ) ;
72
68
0 commit comments