Skip to content

Instantly share code, notes, and snippets.

@killmenot
Created October 5, 2018 18:50
Show Gist options
  • Save killmenot/44f03452b04066f97baa28ad91f6e279 to your computer and use it in GitHub Desktop.
Save killmenot/44f03452b04066f97baa28ad91f6e279 to your computer and use it in GitHub Desktop.
function healthcheck(args, finished) {
finished({
ok: true,
timestamp: Date.now()
});
}
module.exports = {
restModule: true,
init: function (application) {
const routes = [
{
url: '/healthcheck',
method: 'GET',
handler: healthcheck
}
];
router.initialise(routes, module.exports);
router.setErrorResponse(404, 'Not Found');
this.setCustomErrorResponse.call(this, {
application: application,
errorType: 'noTypeHandler',
text: 'Resource Not Found',
statusCode: '404'
});
}
};
'use strict';
const qewd = require('qewd').master;
const path = require('path');
const config = {
managementPassword: 'keepThisSecret!',
serverName: 'My QEWD Server',
port: 8080,
database: {
type: 'redis'
}
};
const routes = [
{
path: '/',
application: 'healthcheck',
module: path.join(__dirname, 'healthcheck')
}
];
qewd.start(config, routes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment