Skip to content

Instantly share code, notes, and snippets.

@CoreProgramm
Created April 29, 2020 16:16
Show Gist options
  • Save CoreProgramm/6b65d2ce99ad4293daaf769b2037cf76 to your computer and use it in GitHub Desktop.
Save CoreProgramm/6b65d2ce99ad4293daaf769b2037cf76 to your computer and use it in GitHub Desktop.
ASP .NET Core Developer Exception Page
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseFileServer();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>
{
await context.Response.WriteAsync("Hello World!");
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment