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
task32/app.js Normal file
View File

@@ -0,0 +1,19 @@
const express = require('express');
const app = express();
app.set('view engine', 'pug');
app.use('/contact', function (request, response) {
response.render('contact', {
title: 'Мои контакты',
emailsVisible: true,
emails: ['gavgav@mycorp.com', 'mioaw@mycorp.com'],
phone: '+1234567890',
});
});
app.use('/', function (request, response) {
response.send('Главная страница');
});
app.listen(3000);

1014
task32/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

8
task32/package.json Normal file
View File

@@ -0,0 +1,8 @@
{
"name": "expressapp",
"version": "1.0.0",
"dependencies": {
"express": "^4.16.4",
"pug": "^3.0.2"
}
}

20
task32/views/contact.pug Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>#{title}</title>
<meta charset="utf-8" />
</head>
<body>
h1 #{title} в Pug
if emailsVisible
h3 Электронные адреса
ul
each email in emails
li=email
else
h3 Электроннный адрес отсутствует
p Телефон: #{phone}
</body>
<html>

View File

@@ -0,0 +1 @@
<footer><p>MyCorp - Copyright © 2017</p></footer>

View File

@@ -0,0 +1,4 @@
<nav>
<a href="/">Главная</a> |
<a href="/contact">Контакты</a>
</nav>