Skip to content

Instantly share code, notes, and snippets.

@evgomes
Created January 25, 2019 12:00
Show Gist options
  • Save evgomes/251f30a7a0590ec1e0910ac2ecf5ac32 to your computer and use it in GitHub Desktop.
Save evgomes/251f30a7a0590ec1e0910ac2ecf5ac32 to your computer and use it in GitHub Desktop.
Default Startup.cs from ASP.NET Core 2.2
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// 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_2);
}
// 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
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseMvc();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment