Instantly share code, notes, and snippets.

Embed
What would you like to do?
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Use(async (context, func) =>
{
if (context.Request.Path.Value == "/hc")
{
context.Response.StatusCode = 200;
context.Response.ContentLength = 2;
await context.Response.WriteAsync("UP");
}
else
{
await func.Invoke();
}
});
app.Run(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