Polevoy_Network_Programming/frontend/index.js

12 lines
290 B
JavaScript
Raw Normal View History

2023-02-07 10:52:36 +04:00
const fs = require('fs')
const http = require('http')
const requestListener = async function (req, res) {
res.writeHead(200);
2023-02-21 11:20:02 +04:00
fs.readFile('index.html', 'utf8', (err, data) => {
2023-02-07 10:52:36 +04:00
res.end(data);
});
};
const server = http.createServer(requestListener)
server.listen(5050)