Skip to content

Commit

Permalink
feat: add healthcheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxbandit committed Oct 20, 2020
1 parent c08f302 commit e98cb48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/middlewares.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});
};
1 change: 1 addition & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e98cb48

Please sign in to comment.