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:
version. There is existing code for this, which reports the value of a configuration variable.
ldapConnected. Logging in using LDAP is two steps: connect to the server, and bind with a username/password. Here we want to perform only the first step, and ensure that there is no error. This may require rearranging some authentication code. Alternatively, we might just try to login using intentionally invalid credentials, and test that we get an authentication failure. Help requests on this are welcome/encouraged.
dbPath: Like version, this reports the value of a config variable: sails.config.custom.datastores.default.url. However, the value may contain username and password, e.g., mysql://USERNAME:PASSWORD@localhost:3306/nlcAttendance. So, any substring starting with ://USERNAME:PASSWORD@ (for any USERNAME and PASSWORD) should be reported without the USERNAME:PASSWORD@ portion, e.g., mysql://localhost:3306/nlcAttendance.
redisConnected. To be determined. This is less critical.
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: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):The four values can be determined as follows.
sails.config.custom.datastores.default.url
. However, the value may contain username and password, e.g.,mysql://USERNAME:PASSWORD@localhost:3306/nlcAttendance
. So, any substring starting with://USERNAME:PASSWORD@
(for any USERNAME and PASSWORD) should be reported without theUSERNAME:PASSWORD@
portion, e.g.,mysql://localhost:3306/nlcAttendance
.