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

§ Ӓܿ     T  "۽ द੘ೞח ࣁ࣌ ௢ః


         s%3A੄ ّࠗ࠙੉ पઁ ঐഐചػ ௢ః ղਊੑפ׮  খী s%3Aо ࠢ਷ ҃਋  ੉ ௢ఃо FYQSFTT TFTTJPO ޷ٜਝয

         ী ੄೧ ঐഐചػ Ѫ੉ۄҊ ࢤпೞݶ ؾפ׮

          
          
               ޷ٜਝয੄ ౠࢿ ഝਊೞӝ

         ޷ٜਝযܳ ૒੽ ٜ݅যࠁӝب ೮Ҋ  ׮ܲ ࢎۈ੉ ݅ٚ ޷ٜਝয ಁః૑ܳ ࢸ஖೧ ੢଱೧ࠁӝب ೮णפ׮  ੉ߣ
         ੺ীࢲ ޷ٜਝয੄ ౠࢿਸ ୨੿ܻ೧ࠇद׮




           app.use((req,	res,	next)	=>	{
           		console.log('모든	요청에	다	실행됩니다.');
           		next();
           });




         ޷ٜਝযח req  res  nextܳ ݒѐ߸ࣻ۽ о૑ח ೣࣻ ী۞ ୊ܻ ޷ٜਝয݅ ৘৻੸ਵ۽ FSS  req  res  nextܳ

         о૘פ׮  ۽ࢲ app.useա app.get  app.post ١ਵ۽ ੢଱೤פ׮  ౠ੿ೠ ઱ࣗ੄ ਃ୒ী݅ ޷ٜਝযо प೯غ
         ѱ ೞ۰ݶ ୐ ߣ૩ ੋࣻ۽ ઱ࣗܳ ֍ਵݶ ؾפ׮




           app.use(
           		morgan('dev'),
           		express.static('/',	path.join(__dirname,	'public')),
           		express.json(),
           		express.urlencoded({	extended:	false	}),
           		cookieParser(process.env.COOKIE_SECRET),
           );
   218   219   220   221   222   223   224   225   226   227   228