Page 240 - Nodejs 교과서 개정2판
P. 240
झۨझ৬ োѾೞ۰ݶ BQQ KTী ࠗ࠙ ٜয যঠ פ
app.js
...
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(morgan('dev'));
...
viewsח మ݁ ੌٜ ਤೠ ಫ؊ܳ ೞח Ѫੑפ res.render ݫࢲ٘о ಫ؊ ӝળਵ۽ మ݁ ূ
ਸ ইࢲ ۪؊݂פ res.render('JOEFY')ۄݶ WJFXT JOEFY QVHܳ ۪؊݂פ res.render('admi
n/main')ۄݶ WJFXT BENJO NBJO QVHܳ ۪؊݂פ
WJFX engine যځೠ ઙܨ మ݁ ূਸ ࢎਊೡܳ աఋշפ അ pug۽ ࢸغয ਵ۽ Ӓ۽ ࢎ
ਊೞݶ ؾפ
ઁࠗఠ ಌӒ ޙߨਸ ঌইࠁݶࢲ )5.-җח যڌѱ ܲ ಝࠇद
)5.- അ
ӝઓ )5.-җ ܰѱ ചҚഐ < >)৬ ײח కӒо হणפ చ ژח झಕझ۽݅ కӒ ࠗݽ ध ҙ҅ܳ
ӏݺפ చ ೠ ߣ झಕझ ف ߣ ژח झಕझ ֎ ߣ ݽف ࢚ҙহणפ ݽٚ ੌী زੌೠ ઙܨ ٜৈ
ॳӝܳ ਊೞݶ ؾפ ध కӒח ࠗݽ కӒࠁ ٜৈॳӝغয যঠ פ ٜৈॳӝী য়ܨо ਵݶ ઁ
۽ ۪؊݂غ ঋਵפ ೞӡ ߄ۉפ
doctype html <!DOCTYPE html>җ эणפ html head title కӒীࢲח ध కӒੌࣻ۾ ೠ ױ҅ঀ ؊ ٜ
ৈॳӝغয ח ݽणਸ ࠅ ࣻ णפ title= title ࠗ࠙ ীࢲ ܛפ
ചҚഐо হਵ۽ కӒ ࣘࢿب ઑӘ ܰѱ അפ కӒݺ ٍী ࣗҚഐ۽ ޘয णפ
ಌӒ )5.-
doctype html <!DOCTYPE html>
html <html>
head <head>
title= title <title>익스프레스</title>
link(rel='stylesheet', href='/stylesheets/st <link rel="stylesheet" href="/style.css" />
yle.css') </head>
</html>