adding a healthcheck endpoint that confirms communication with influxdb and sqlite.

ref: #381
This commit is contained in:
Jason Kulatunga
2022-11-30 08:25:27 -08:00
parent 58ef1aa311
commit f2856e0f26
4 changed files with 54 additions and 9 deletions
+1 -9
View File
@@ -34,15 +34,7 @@ func (ae *AppEngine) Setup(logger *logrus.Entry) *gin.Engine {
{
api := base.Group("/api")
{
api.GET("/health", func(c *gin.Context) {
//TODO:
// check if the /web folder is populated.
// check if access to influxdb
// check if access to sqlitedb.
c.JSON(http.StatusOK, gin.H{
"success": true,
})
})
api.GET("/health", handler.HealthCheck)
api.POST("/health/notify", handler.SendTestNotification) //check if notifications are configured correctly
api.POST("/devices/register", handler.RegisterDevices) //used by Collector to register new devices and retrieve filtered list