// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider) { if (_env.IsDevelopment()) { app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true }); app.UseStaticFiles(new StaticFileOptions { OnPrepareResponse = context => { context.Context.Response.Headers.Add("Cache-Control", "no-cache"); context.Context.Response.Headers.Add("Expires", "-1"); } }); } else { app.UseStaticFiles(); app.SetSecurityHeaders(); } app.UseStatusCodePagesWithReExecute("/error/{0}"); app.AddContentLanguageHeaders("en"); var config = serviceProvider.GetService <SearchUiConfig>(); config.Validate(); _logger.LogInformation($"Using API base URL: {config.ApiUrl}"); app.UseMvc(routes => { routes.MapRoute("cookies", "cookies", defaults: new { controller = "Legal", action = "Cookies" }); routes.MapRoute("privacy", "privacy-policy", defaults: new { controller = "Legal", action = "Privacy" }); routes.MapRoute("tandc", "terms-conditions", defaults: new { controller = "Legal", action = "TandC" }); routes.MapRoute("sitemap", "sitemap.txt", defaults: new { controller = "Sitemap", action = "Index" }); }); }