Skip to content

Instantly share code, notes, and snippets.

@CoreProgramm
Created April 30, 2020 14:32
Show Gist options
  • Save CoreProgramm/94029fd464c53b1cd52e5c57bff7b937 to your computer and use it in GitHub Desktop.
Save CoreProgramm/94029fd464c53b1cd52e5c57bff7b937 to your computer and use it in GitHub Desktop.
Custom Middleware
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCustomLoggerMiddleware();
app.Run(async (context) =>
{
await context.Response.Body.WriteAsync(Encoding.ASCII.GetBytes("This is called from Configure() method response"));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment