Polevoy_Network_Programming/frontend/index.js
Katerina881 8315a23855 Lab2
2023-02-21 11:20:02 +04:00

12 lines
290 B
JavaScript

const fs = require('fs')
const http = require('http')
const requestListener = async function (req, res) {
res.writeHead(200);
fs.readFile('index.html', 'utf8', (err, data) => {
res.end(data);
});
};
const server = http.createServer(requestListener)
server.listen(5050)