This commit is contained in:
User1
2023-11-08 14:02:38 +03:00
parent 2123d65584
commit 2e57518d5f
118 changed files with 15715 additions and 0 deletions

16
Шаблоны/app.js Normal file
View File

@@ -0,0 +1,16 @@
const http = require('http');
const fs = require('fs');
http.createServer(function (request, response) {
fs.readFile('index.html', 'utf8', function (
error,
data
) {
let message = 'Изучаем Node.js';
let header = 'Главная страница';
data = data
.replace('{header}', header)
.replace('{message}', message);
response.end(data);
});
}).listen(3000);

12
Шаблоны/index.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Главная</title>
<meta charset="utf-8" />
</head>
<body>
<h1>Главная страница</h1>
<p>ТИС крутой предмет</p>
</body>
<html></html>
</html>