Created
October 5, 2018 18:50
-
-
Save killmenot/44f03452b04066f97baa28ad91f6e279 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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