Last active
June 28, 2018 20:47
-
-
Save dcomartin/b690310ce5bfa2b67ec0659c92d0bffc to your computer and use it in GitHub Desktop.
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
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