Skip to content

TerribleDev/Alive.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple asp.net core 1.0 middlewear to add a livecheck to your app without having to make controllers, and what not. This is useful to keep your livecheck requests out of your MVC action filter lifecycle

Usage

Install-Package Alive.Net

Ultra-Simple:

//this will default to /livecheck with 200
app.UseAlive(a =>
            {

            });

Simple

app.UseAlive(a =>
            {
                a.BodyText = "Im awesome";
                a.StatusCode = System.Net.HttpStatusCode.OK;
                a.LivecheckPath = new Microsoft.AspNet.Http.PathString("/CustomLivecheck");
            });

Complex

app.UseAlive(a =>
           a.OnLivecheckResponse = (response) =>
           {
               if(ThingsThatCouldMakeOurAppDown)
               {
                   response.BodyText = "awesome";
                   response.StatusCode = System.Net.HttpStatusCode.BadGateway;
               }
               else
               {
                   response.BodyText = "awesome";
                   response.StatusCode = System.Net.HttpStatusCode.OK;
               }
           });

About

Livecheck middlewear for aspnet core 1.0

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors