mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
15 lines
286 B
JavaScript
15 lines
286 B
JavaScript
const http = require('http')
|
|
const port = process.env.PORT || 3000
|
|
|
|
const server = new http.Server(async (req, res) => {
|
|
res.end(JSON.stringify({ foo: 'bar' }))
|
|
})
|
|
|
|
server.listen(port, (err) => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
|
|
console.log(`> Ready on http://localhost:${port}`)
|
|
})
|