// 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); //Implementation for the Dependencies DependenciesImplementation.EnableDependencies(services); //Implement the Swagger UI SwaggerImplementation.EnableSwagger(services); //Implemenation for the API Versioning ApiVersionImplementation.EnablingVersioning(services); //Implemenation for the JWT Token JWTImplementation.EnablingJWTAuthentication(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(); } //Enables the JWT Authentication app.UseAuthentication(); app.UseHttpsRedirection(); app.UseMvc(); //Implemented the Middleware for Exception Handling app.UseExceptionHandlingMiddleware(); //Configure Swgger UI SwaggerImplementation.ConfigureSwagger(app, env); }