// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseDefaultFiles(); app.UseStaticFiles(); app.UseWebSockets(); app.UseHttpsRedirection(); app.UseMvc(); // JWT JwtAuthConfig.AddRegistration(app, this._configuration); // Cors CorsConfig.AddRegistration(app); //GraphQL GraphQLConfig.AddRegistration(app); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>(); // Inject Dependecies IoCRegister.AddRegistration(services); // JWT JwtAuthConfig.AddRegistration(services, this._configuration); // Cors CorsConfig.AddRegistration(services); //GraphQL GraphQLConfig.AddRegistration(services); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); // Swagger SwaggerConfig.AddRegistration(services); // AutoMapper AutoMapperConfig.AddRegistration(services); // Inject Dependecies IoCRegister.AddRegistration(services); // JWT JwtAuthConfig.AddRegistration(services, _configuration); // Cors CorsConfig.AddRegistration(services); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } // Swagger SwaggerConfig.AddRegistration(app); // JWT JwtAuthConfig.AddRegistration(app, this._configuration); // Cors CorsConfig.AddRegistration(app); app.UseHttpsRedirection(); app.UseAuthentication(); app.UseHttpsRedirection(); app.UseMvc(); }