public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { _app = app; UseSerilogLogging(loggerFactory); app.UseAuthentication(); //1 . Enable CORS. app.UseCors("AllowAll"); // 2. Use static files. app.UseStaticFiles(); // 3. Redirect error to custom pages. app.UseStatusCodePagesWithRedirects("~/Error/{0}"); // 4. Configure the modules. _moduleLoader.Configure(app); // 5. Configure ASP.NET MVC app.UseMvc(routes => { _moduleLoader.Configure(routes); }); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(); app.UseAuthentication(); app.UseCors("AllowAll"); _moduleLoader.Configure(app); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action}/{id?}"); }); }