This commit is contained in:
kogleee
2023-11-08 13:17:48 +03:00
commit 3dbd9654c2
136 changed files with 14736 additions and 0 deletions

19
task12/3/app.js Normal file
View File

@@ -0,0 +1,19 @@
const http = require('http');
http.createServer(function (request, response) {
response.setHeader(
'Content-Type',
'text/html; charset=utf-8;'
);
if (request.url === '/home' || request.url === '/') {
response.write('<h2>Home</h2>');
} else if (request.url == '/about') {
response.write('<h2>About</h2>');
} else if (request.url == '/contact') {
response.write('<h2>Contacts</h2>');
} else {
response.write('<h2>Not found</h2>');
}
response.end();
}).listen(3000);