db-rest/index.js
2017-10-24 23:28:12 +02:00

18 lines
347 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict'
const http = require('http')
const api = require('./api')
const server = http.createServer(api)
const port = process.env.PORT || 3000
const hostname = process.env.HOSTNAME || ''
server.listen(port, (err) => {
if (err) {
console.error(err)
process.exit(1)
} else {
console.info(`Listening on ${hostname}:${port}.`)
}
})