Абсолютный новичок здесь. Я только что настроил новый сервер с помощью node.js, но застрял на представлениях мопсов. Попытка расширить login.pug в index.pug, но все, что я получаю, это пустой контент, кроме нижнего колонтитула и заголовка. Где я сделал неправильно? Помогите, пожалуйста... p/s: мопс уже установлен
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
// for parsing application/json
app.use(bodyParser.json());
// for parsing application/xwww-
app.use(bodyParser.urlencoded({
extended: true
}));
//form-urlencoded
app.get('/', function (req, res) {
res.render('index');
});
// for parsing multipart/form-data
app.use(upload.array());
app.use(express.static('public'));
//index.pug
doctype html
html(lang = "en")
head
meta( charset = "utf-8")
meta( name = "viewport" content = "width=device-width, initial-scale=1")
title COMPANY WEBAPP
meta( name = "description" content = "MKE Web App.")
meta( name = "keywords" content = "MKE Web App.")
link( rel = "shortcut icon" type = "image/png" href = "img/icon/favicon.png")
link( rel = "stylesheet" type = "text/css" href = "css/index.css")
link( rel = "stylesheet" type = "text/css" href = "css/default.css")
body
block content
footer
p( id = "copyright") Copyright © 2019
p( id = "visitcount") Loading...
script( type = "text/javascript" src = "/socket.io/socket.io.js")
script( type = "text/javascript" src = "js/hmac-sha3.js")
script( type = "text/javascript" src = "js/index.js")
//login.pug
extends index
block content
div(class = "login-continer")
form( class = "form-login default-box" method = "POST" action = "/login")
div
label( for = "user-id") <strong>User ID :</strong>
span( class = "span-login-symbol") 👱
input( class = "default-input" id = "user-id" type = "test" placeholder = "user id" value = "" spellcheck = "false" required)
div
label( for = "user-email") <strong>Email :</strong>
span( class = "span-login-symbol") 💌
input( class = "default-input" id = "user-email" type = "email" placeholder = "user email" value = "" spellcheck = "false" required)



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


app.get('/', function (req, res) {
res.render('index');
});
Вы визуализируете index.pub при получении. Однако вы не расширили логин.паб в свой индекс. Вместо этого вы расширяете индекс в свой логин.паб
Если вы просто измените рендеринг на вход в систему, вы сможете увидеть новый контент.
app.get('/', function (req, res) {
res.render('login');
});