diff --git a/lib/api-server.js b/lib/api-server.js index aa9809d..ac518ab 100644 --- a/lib/api-server.js +++ b/lib/api-server.js @@ -76,12 +76,17 @@ class APIServer { setupRoutes() { this.server.get('/healthz', (req, res, next) => { const redis = plugins.handler.options.db.redis; - console.log(redis); - res.json(200, { - redis: true + redis.ping((err, result) => { + console.log(err, result); + const status = err ? 500 : 200; + + res.json(status, { + redis: err ? err : result + }); + + return next(); }); - return next(); }); // Example handler for authentication. You should probably override it