Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강상위
/
my-broadcasting
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강상위
2018-12-08 02:33:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8068ea0db0df58584cfe57c7655a5f6dfe83d32a
8068ea0d
1 parent
bfeebb3e
Feature Skeleton - view mypage
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
server_db/routing.js
server_db/views/contents_mypage.ejs
server_db/views/mypage.ejs
server_db/views/navigation_main.ejs
server_db/routing.js
View file @
8068ea0
...
...
@@ -33,7 +33,8 @@ module.exports = function(app, Users)
// Join
app
.
route
(
'/join'
)
.
get
(
function
(
req
,
res
)
// 처음 Join화면 랜더 - GET
// 처음 Join화면 랜더 - GET
.
get
(
function
(
req
,
res
)
{
res
.
render
(
"join"
)
})
...
...
@@ -60,6 +61,30 @@ module.exports = function(app, Users)
});
// 마이페이지 - 로그인 필수
app
.
get
(
'/mypage'
,
function
(
req
,
res
)
{
// 로그인 중이라면
if
(
req
.
isAuthenticated
())
{
// find를 쓰면, 다행으로 반환되기 때문에 결과의 첫번째 요소를 지정하고 해야함
// 그래서 하나만을 대상으로 할 때는 보통 findOne을 사용
// mongoose로 디비 find는 콜백으로 정의해야함.
Users
.
findOne
({
id
:
req
.
user
},
function
(
err
,
user_info
)
{
console
.
log
(
"mypage"
);
res
.
render
(
"mypage"
,
{
id
:
user_info
.
id
,
name
:
user_info
.
name
});
});
}
// 로그인 중이 아니라면
else
res
.
redirect
(
"/"
);
});
}
...
...
server_db/views/contents_mypage.ejs
0 → 100644
View file @
8068ea0
<div class="contents_main">
<h1>mypage</h1>
<div><label>id:</label><%=id %></div>
<div><label>name:</label><%=name %></div>
</div>
\ No newline at end of file
server_db/views/mypage.ejs
0 → 100644
View file @
8068ea0
<html>
<head>
<title>
MyPage
</title>
</head>
<body>
<
% include ./navigation_main.ejs %>
<
% include ./contents_mypage.ejs %>
</body>
</html>
\ No newline at end of file
server_db/views/navigation_main.ejs
View file @
8068ea0
<div class="navigation_main">
<a href="/logout"><button>로그아웃</button></a>
<button>검색</button>
<
button>마이페이지</button
>
<
a href="/mypage"><button>마이페이지</button></a
>
<button>나만의시간표</button>
</div>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment