service-core/test/testapp/ok/index.mjs
Jonatan Nilsson 4f4bc8cf6a
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
More core development, full integration started
2022-02-11 13:59:10 +00:00

17 lines
515 B
JavaScript

export function start(http, port, ctx) {
const server = http.createServer(function (req, res) {
res.writeHead(200);
res.end(JSON.stringify({ version: 'exampleindex' }))
})
return new Promise(function(res, rej) {
server.listen(port || 4000, '0.0.0.0', function(err) {
if (err) {
return rej(err)
}
ctx.log.event.info(`Server is listening on ${port} serving exampleindex`)
ctx.log.info(`Server is listening on ${port} serving exampleindex`)
res()
})
})
}