db-rest/index.js

19 lines
347 B
JavaScript
Raw Normal View History

2017-10-23 23:13:53 +02:00
'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}.`)
}
})