dewv / nlcAttendance

Attendance tracking for the Naylor Learning Center at Davis & Elkins College
MIT License
2 stars 2 forks source link

Create route for "production health check" #109

Closed smattingly closed 3 years ago

smattingly commented 4 years ago

We recently added a /version.txt route to the application, which causes the server to respond with plain ASCII text containing the application version number:

$ curl https://dewv.net/nlc_attendance/version.txt
2.3.0

We want to modify and expand the route to better support an automated check of the application's health status. The goal is to report:

The path should be changed from /version.txt to /status.json, and it should respond as follows (obviously, data values may vary):

$ curl https://dewv.net/nlc_attendance/status.json
{
  "version": "2.3.0",
  "ldapConnected": true,
  "dbPath": "localhost:3306/nlcAttendance",
  "redisConnected": true
}

The four values can be determined as follows.