siggame / colisee-template

A template for colisee microservices to be based off
0 stars 0 forks source link

Add health endpoint #7

Open russleyshaw opened 7 years ago

russleyshaw commented 7 years ago

Used to gauge health of service. Ideally, an administration page can show us the uptime of our services and any major errors or warnings. For example: In a service with a long startup time, they can broadcast a warning status, saying they are not fully "up" yet

GET /api/health

The endpoint shall:`

Status types include

message in ok status can be ignored but should be provided anyways, even if empty string

It might be a good idea to add a type somewhere

interface HealthResponse {
    status: "ok" | "warn" | "err";
    message: string;
    last_updated: <some time type or string>
}

I'd also recommend adding an exported function called updateHealth(status, message), which will update the status message, as well as set the last updated time.

russleyshaw commented 7 years ago

@LoneGalaxy When working on this, create a new branch and push your code to that so I can review it when a PR is created

HannahStroble commented 7 years ago

Health endpoint created. Need to test. The code is pushed to the Healthendpoint-branch.