From 6cd94bca4d197f34173aaad9a147191da8d51d6d Mon Sep 17 00:00:00 2001 From: Wardormeur Date: Fri, 10 Nov 2017 11:19:13 +0000 Subject: [PATCH] Add ping for liveness (#17) * Add ping for liveness * ES6-ed --- cd-organisations.js | 4 +++- lib/ping.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 lib/ping.js diff --git a/cd-organisations.js b/cd-organisations.js index 390ec46..19e68eb 100644 --- a/cd-organisations.js +++ b/cd-organisations.js @@ -4,6 +4,8 @@ const orgEntity = require('./lib/organisations/entities/org'); const userOrgEntity = require('./lib/organisations/entities/userOrg'); const orgController = require('./lib/organisations/controllers/org/index'); const userOrgController = require('./lib/organisations/controllers/userOrg/index'); +// Utils +const pingCmd = require('./lib/ping'); function cdOrganisations() { // https://github.com/senecajs/seneca/issues/112 @@ -69,7 +71,7 @@ function cdOrganisations() { }); // Load utilities - // -> none atm + seneca.add({ role: plugin, cmd: 'ping' }, pingCmd); return { name: plugin, diff --git a/lib/ping.js b/lib/ping.js new file mode 100644 index 0000000..4d47e12 --- /dev/null +++ b/lib/ping.js @@ -0,0 +1,4 @@ +const ping = (args, done) => { + done(null, { status: 'ok' }); +}; +module.exports = ping;