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

ҙೠ ੿ࠁٜਸ  res ё୓ח ਽׹ী ҙೠ ੿ࠁٜਸ ׸Ҋ ੓णפ׮

         ই૒਷ ௏٘ܳ प೯೧ب ইޖ ੌب ੌযա૑ ঋणפ׮  ਃ୒ী ؀ೠ ਽׹ب ֍য઱૑ ঋওҊ ࢲߡ৬ োѾೞ૑ب

         ঋওӝ ٸޙੑפ׮  ׮਺ ৘ઁীࢲ ਽׹ਸ ࠁղח ࠗ࠙җ ࢲߡী োѾೞח ࠗ࠙ਸ ୶о೧ࠁѷणפ׮

          server1.js

           const	http	=	require('http');


           http.createServer((req,	res)	=>	{
           		res.writeHead(200,	{	'Content-Type':	'text/html;	charset=utf-8'	});
           		res.write('<h1>Hello	Node!</h1>');
           		res.end('<p>Hello	Server!</p>');
           })
           		.listen(8080,	()	=>	{	//	서버	연결
           				console.log('8080번	포트에서	서버	대기	중입니다!');
           		});




         ௏٘ܳ ࢸݺೞӝী খࢲ ݢ੷ ୐ ࢲߡܳ प೯೧ࠇद׮

          콘솔

           $	node	server1
           8080번	포트에서	서버	대기	중입니다!




         ௑ࣛী ਤ৬ э਷ ޙ੢੉ ա৳׮ݶ ࢿҕੑפ׮  ੉ઁ ਢ ࠳ۄ਋੷ܳ ৌয IUUQ   MPDBMIPTU      ژח IUUQ
                      ী ੽ࣘ೤פ׮



           /PUF ™ MPDBMIPTU৬ ನ౟ۆ

           MPDBMIPTUח അ੤ ஹೊఠ੄ ղࠗ ઱ࣗܳ оܻఈפ׮  ৻ࠗীࢲח ੽Ӕೡ ࣻ হҊ ੗न੄ ஹೊఠীࢲ݅ ੽Ӕೡ ࣻ ੓ਵ޲۽  ࢲ

           ߡ ѐߊ द పझ౟ਊਵ۽ ݆੉ ࢎਊؾפ׮  MPDBMIPTU ؀न          ਸ ઱ࣗ۽ ࢎਊ೧ب эणפ׮  ੉۞ೠ ं੗ ઱ࣗܳ *1 *OU
           FSOFU 1SPUPDPM ۄҊ ࠗܵפ׮

           ನ౟ח ࢲߡ ղীࢲ ೐۽ࣁझܳ ҳ࠙ೞח ߣഐੑפ׮  ࢲߡח )551 ਃ୒ਸ ؀ӝೞח Ѫ ৻ীب ׮নೠ ੘সਸ ೤פ׮  ؘ੉ఠ
           ߬੉झ৬ب ాन೧ঠ ೞҊ  '51 ਃ୒ਸ ୊ܻೞӝب ೤פ׮  ٮۄࢲ ࢲߡח ೐۽ࣁझী ನ౟ܳ ׮ܰѱ ೡ׼ೞৈ ٜযয়ח ਃ୒

           ਸ ҳ࠙೤פ׮  ਬݺೠ ನ౟ ߣഐ۽ח    '51      )551       )5514        .:42- ੉ ੓णפ׮  ನ౟ ߣഐח *1 ઱ࣗ
           ٍী ௒ۿ   җ ೣԋ ࠢৈ ࢎਊ೤פ׮
            
   148   149   150   151   152   153   154   155   156   157   158