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

GET	/profile  GET	/join  GET /ө૑ ୨ ࣁ ѐ੄ ಕ੉૑۽ ҳࢿغয ੓णפ׮  router.use۽ ۄ਋ఠਊ ޷ٜਝ

         যܳ ٜ݅য మ೒݁ ূ૓ীࢲ ࢎਊೡ user  followingCount  followerCount  followerIdList ߸ࣻܳ res.loc
         als۽ ࢸ੿೮णפ׮  ૑Ә਷ пп null  0  0  []੉૑݅ ա઺ী чਸ ֍ਸ Ѫੑפ׮  res.locals۽ чਸ ࢸ੿ೞ

         ח ੉ਬח user  followingCount  followerCount  followerIdList ߸ࣻܳ ݽٚ మ೒݁ ূ૓ীࢲ ҕాਵ۽ ࢎ
         ਊೞӝ ٸޙੑפ׮


         SFOEFS ݫࢲ٘ উ੄ twitsب ૑Ә਷ ࠼ ߓৌ੉૑݅ ա઺ী чਸ ֍णפ׮

         Ӓ׮਺਷ ௿ۄ੉঱౟ ௏٘ੑפ׮  DTTա IUNM ౵ੌٜ਷ Ӓܻ ઺ਃೞ૑ ঋਵפ IUUQT   HJUIVC DPN [FSPDIP

         OPEFKT CPPLীࢲ ૒੽ ௏٘ܳ ࠂࢎೞח Ѫਸ ୶ୌ೤פ׮

          view/layout.html

           <!DOCTYPE	html>
           <html>
           		<head>
           				<meta	charset="UTF-8">
           				<title>{{title}}</title>
           				<meta	name="viewport"	content="width=device-width,	user-scalable=no">
           				<meta	http-equiv="X-UA-Compatible"	content="IE=edge">
           				<link	rel="stylesheet"	href="/main.css">
           		</head>
           		<body>
           				<div	class="container">
           						<div	class="profile-wrap">
           								<div	class="profile">
           										{%	if	user	and	user.id	%}
           												<div	class="user-name">{{'안녕하세요!	'	+	user.nick	+	'님'}}</div>
           												<div	class="half">
           														<div>팔로잉</div>
           														<div	class="count	following-count">{{followingCount}}</div>
           												</div>
           												<div	class="half">
           														<div>팔로워</div>
           														<div	class="count	follower-count">{{followerCount}}</div>
           												</div>
           										<input	id="my-id"	type="hidden"	value="{{user.id}}">
           										<a	id="my-profile"	href="/profile"	class="btn">내	프로필</a>
           										<a	id="logout"	href="/auth/logout"	class="btn">로그아웃</a>
           								{%	else	%}
           										<form	id="login-form"	action="/auth/login"	method="post">
           												<div	class="input-group">
           														<label	for="email">이메일</label>
           														<input	id="email"	type="email"	name="email"	required	autofocus>
           												</div>
   384   385   386   387   388   389   390   391   392   393   394