Created
April 29, 2020 16:36
-
-
Save CoreProgramm/d2d21aff0e2a2b689ba7956f2c3634f6 to your computer and use it in GitHub Desktop.
ASP .NET Core Developer Exception Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 => | |
{ | |
throw new Exception("Error Occurred while processing your request"); | |
await context.Response.WriteAsync("Hello World!"); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment