diff --git a/lib/middlewares.js b/lib/middlewares.js index 67b5dbbd..4ca67d23 100644 --- a/lib/middlewares.js +++ b/lib/middlewares.js @@ -31,3 +31,15 @@ exports.errorHandler = (err, req, res, next) => { /* istanbul ignore next */ return errors.makeInternalError(res, err); }; + +/* istanbul ignore next */ +exports.healthcheck = (req, res) => { + return res.json({ + success: true, + data: { + name: packageInfo.name, + description: packageInfo.description, + version: packageInfo.version + } + }); +}; diff --git a/lib/server.js b/lib/server.js index f62f97f2..2370d534 100644 --- a/lib/server.js +++ b/lib/server.js @@ -13,6 +13,7 @@ const middlewares = require('./middlewares.js'); const config = require('./config/configFile.js'); const redis = require('./redis.js'); +GsuiteRouter.get('/healthcheck', middlewares.healthcheck); GsuiteRouter.post('/group', wrapper.createGroup); //circle is created -> create a group //GsuiteRouter.put('/group', wrapper.modifyGroup); //circle is modified -> group is modified