Page 248 - Nodejs 교과서 개정2판
P. 248

ք੸झח ಌӒ੄ )5.- ޙߨ ߸ചী ੸਽ೞӝ ൨ٚ ࠙ীѱ ੸೤ೠ మ೒݁ ূ૓੉ݴ  ౵੉য಩झܳ ݅ٚ ݽ૕ۄ

         ীࢲ ٜ݅঻णפ׮  )5.- ޙߨਸ Ӓ؀۽ ࢎਊೞغ ୶о۽ ੗߄झ௼݀౟ ޙߨਸ ࢎਊೡ ࣻ ੓Ҋ  ౵੉ॆ੄ మ೒
         ݁ ূ૓ੋ 5XJH৬ ޙߨ੉ ࢚׼൤ ਬࢎ೤פ׮

         ք੸झܳ ࢸ஖೤פ׮


          콘솔
           $	npm	i	nunjucks




         view engineਸ ಌӒ ؀न ք੸झ۽ Ү୓೤פ׮


          app.js
           ...
           const	path	=	require('path');
           const	nunjucks	=	require('nunjucks');


           dotenv.config();
           const	indexRouter	=	require('./routes');
           const	userRouter	=	require('./routes/user');


           const	app	=	express();
           app.set('port',	process.env.PORT	||	3000);
           app.set('view	engine',	'html');


           nunjucks.configure('views',	{
           		express:	app,
           		watch:	true,
           });


           app.use(morgan('dev'));
           ...





         ಌӒ৬ח োѾ ߑߨ੉ ׮ࣗ ׮ܵפ׮  configure੄ ୐ ߣ૩ ੋࣻ۽ WJFXT ಫ؊੄ ҃۽ܳ ֍Ҋ  ف ߣ૩ ੋࣻ۽
         ২࣌ਸ ֍णפ׮  ੉ٸ express ࣘࢿী app ё୓ܳ োѾ೤פ׮  watch ২࣌੉ true੉ݶ )5.- ౵ੌ੉ ߸҃ؼ
         ٸ మ೒݁ ূ૓ਸ ׮द ۪؊݂೤פ׮


         ౵ੌ਷ ಌӒ৬ э਷ ౠࣻೠ ഛ੢੗ ؀न IUNMਸ Ӓ؀۽ ࢎਊ೧ب ؾפ׮  ք੸झ੐ਸ ҳ࠙ೞ۰ݶ ഛ੢੗۽ OKL
         ܳ ॳݶ ؾפ׮  ױ  ੉ٸח view engineب OKL۽ ߄Լঠ ೤פ׮


         ੉ઁ ք੸झ੄ ޙߨਸ ߓਕࠁѷणפ׮  ಌӒ৬ ৘ઁо эਵ޲۽ ࠺Үೞݶࢲ ࠁݶ જणפ׮

          
   243   244   245   246   247   248   249   250   251   252   253