2020-05-12 21:58:21 +02:00
|
|
|
const http = require('http')
|
|
|
|
const port = process.env.PORT || 3000
|
|
|
|
|
|
|
|
const server = new http.Server(async (req, res) => {
|
|
|
|
res.end(JSON.stringify({ foo: 'bar' }))
|
|
|
|
})
|
|
|
|
|
2020-05-18 21:24:37 +02:00
|
|
|
server.listen(port, (err) => {
|
2020-05-12 21:58:21 +02:00
|
|
|
if (err) {
|
|
|
|
throw err
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(`> Ready on http://localhost:${port}`)
|
|
|
|
})
|