service-core/test/exampleindex.mjs
2022-01-28 11:47:55 +00:00

17 lines
No EOL
540 B
JavaScript

export function start(db, log, core, http, port) {
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)
}
log.event.info(`Server is listening on ${port} serving package ${staticPackage}`)
log.info(`Server is listening on ${port} serving package ${staticPackage}`)
res()
})
})
}