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

btn.addEventListener('click',	addBtnEvent);
           		});
           </script>
           {%	endblock	%}


           {%	block	script	%}
           <script>
           		window.onload	=	()	=>	{
           				if	(new	URL(location.href).searchParams.get('error'))	{
           						alert(new	URL(location.href).searchParams.get('error'));
           				}
           		};
           </script>
           {%	endblock	%}




         io.connect ݫࢲ٘੄ ઱ࣗо ׳ۄ઎׮ח ੼ী ઱ݾ೧઱ࣁਃ  ઱ࣗ ٍী  SPPN੉ ࠢ঻णפ׮  ੉Ѫਸ ֎੐झಕ
         ੉झۄҊ ࠗܰݴ  ࢲߡীࢲ  SPPN ֎੐झಕ੉झܳ ా೧ ࠁմ ؘ੉ఠ݅ ߉ਸ ࣻ ੓णפ׮  ֎੐झಕ੉झܳ ৈ۞

         ѐ ҳ࠙೧ ઱Ҋ߉ਸ ؘ੉ఠܳ ࠙ܨೡ ࣻ ੓णפ׮

         socketীח ޷ܻ newRoomҗ removeRoom ੉߮౟ܳ ׳ইف঻णפ׮  ࢲߡীࢲ ਢ ࣗ௄ਵ۽ ೧׼ ੉߮౟ܳ ߊࢤद

         ఃݶ ੉߮౟ ܻझց੄ ௒ߔ ೣࣻо प೯ؾפ׮  ௒ߔ ೣࣻ੄ ղਊ੉ ӡ૑݅ ౠ߹ೠ Ѫ਷ হणפ׮  пп ప੉࠶
         ী ࢜۽਍ ߑ ݾ۾ਸ ୶оೞѢա ઁѢೞח ௏٘ੑפ׮  ੑ੢ ߡౡਸ ־ܰݶ  ࠺޻ߑੌ ҃਋ ࠺޻ߣഐܳ ߉Ҋ ҕ

         ѐߑੌ ҃਋ ߄۽ ੑ੢दఈפ׮

         ଻౴ߑ ࢤࢿ ചݶਸ ׸׼ೞח SPPN IUNM ౵ੌਸ ੘ࢿ೤פ׮


          views/room.html
           {%	extends	'layout.html'	%}


           {%	block	content	%}
           		<fieldset>
           				<legend>채팅방	생성</legend>
           				<form	action="/room"	method="post">
           						<div>
           								<input	type="text"	name="title"	placeholder="방	제목">
           						</div>
           						<div>
           								<input	type="number"	name="max"	placeholder="수용	인원(최소	2명)"	min="2"	value="10">
           						</div>
           						<div>
           								<input	type="password"	name="password"	placeholder="비밀번호(없으면	공개방)">
           						</div>
           						<div>
   532   533   534   535   536   537   538   539   540   541   542