You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
314 B
14 lines
314 B
3 years ago
|
const http = require("http")
|
||
|
const fs = require("fs")
|
||
|
|
||
|
const port = process.env.PORT || 3000
|
||
|
|
||
|
const server = http.createServer((req, res) => {
|
||
|
res.writeHead(200, { "content-type": "text/html" })
|
||
|
fs.createReadStream("index.html").pipe(res)
|
||
|
})
|
||
|
|
||
|
server.listen(port)
|
||
|
|
||
|
console.log(`Listening on the port ${port}.`)
|