Showing
8 changed files
with
19 additions
and
16 deletions
... | @@ -19,9 +19,9 @@ | ... | @@ -19,9 +19,9 @@ |
19 | <!-- Navigation--> | 19 | <!-- Navigation--> |
20 | <nav class="navbar navbar-light bg-light static-top"> | 20 | <nav class="navbar navbar-light bg-light static-top"> |
21 | <div class="container"> | 21 | <div class="container"> |
22 | - <a class="navbar-brand" href="http://localhost:3000/">묵호의 놀이터</a> | 22 | + <a class="navbar-brand" href="/main">묵호의 놀이터</a> |
23 | <div class="user"> | 23 | <div class="user"> |
24 | - <a class="btn btn-primary" href="http://localhost:3000/register">회원가입</a> | 24 | + <a class="btn btn-primary" href="/register">회원가입</a> |
25 | </div> | 25 | </div> |
26 | </div> | 26 | </div> |
27 | </nav> | 27 | </nav> | ... | ... |
... | @@ -19,10 +19,10 @@ | ... | @@ -19,10 +19,10 @@ |
19 | <!-- Navigation--> | 19 | <!-- Navigation--> |
20 | <nav class="navbar navbar-light bg-light static-top"> | 20 | <nav class="navbar navbar-light bg-light static-top"> |
21 | <div class="container"> | 21 | <div class="container"> |
22 | - <a class="navbar-brand" href="http://localhost:3000/">묵호의 놀이터</a> | 22 | + <a class="navbar-brand" href="/main">묵호의 놀이터</a> |
23 | <div class="user"> | 23 | <div class="user"> |
24 | - <a class="btn btn-primary" href="http://localhost:3000/login">로그인</a> | 24 | + <a class="btn btn-primary" href="/login">로그인</a> |
25 | - <a class="btn btn-primary" href="http://localhost:3000/register">회원가입</a> | 25 | + <a class="btn btn-primary" href="/register">회원가입</a> |
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | </nav> | 28 | </nav> | ... | ... |
... | @@ -24,4 +24,5 @@ DB 구조(*ID, password, type) -> 형식에 맞게 추가<br> | ... | @@ -24,4 +24,5 @@ DB 구조(*ID, password, type) -> 형식에 맞게 추가<br> |
24 | LF 오류시 git config --global core.autocrlf true 입력<br><br> | 24 | LF 오류시 git config --global core.autocrlf true 입력<br><br> |
25 | 25 | ||
26 | 26 | ||
27 | -최종 수정: 2021-11-16 14:03 | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
27 | +최종 수정: 2021-11-16 18:54<br> | ||
28 | +최종 수정 내용: 경로 지정 수정 | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -5,10 +5,12 @@ var path = require('path') // 상대경로 | ... | @@ -5,10 +5,12 @@ var path = require('path') // 상대경로 |
5 | 5 | ||
6 | // main page는 login이 된 상태(세션정보가 있을때만) 접근이 가능하게 하자 -> info에 구현해놓음. | 6 | // main page는 login이 된 상태(세션정보가 있을때만) 접근이 가능하게 하자 -> info에 구현해놓음. |
7 | router.get('/', function(req, res){ | 7 | router.get('/', function(req, res){ |
8 | - console.log(req.user, '유저가 작업 중입니다.') | ||
9 | var id = req.user; | 8 | var id = req.user; |
10 | if(!id) res.sendFile(path.join(__dirname, "../../public/main.html")) | 9 | if(!id) res.sendFile(path.join(__dirname, "../../public/main.html")) |
11 | - if(id) res.render('main.ejs', {'ID': id}); | 10 | + if(id){ |
11 | + console.log(req.user, '유저가 작업 중입니다.') | ||
12 | + res.render('main.ejs', {'ID': id}); | ||
13 | + } | ||
12 | }); | 14 | }); |
13 | 15 | ||
14 | module.exports = router; | 16 | module.exports = router; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -10,10 +10,10 @@ | ... | @@ -10,10 +10,10 @@ |
10 | <!-- Navigation--> | 10 | <!-- Navigation--> |
11 | <nav class="navbar navbar-light bg-light static-top"> | 11 | <nav class="navbar navbar-light bg-light static-top"> |
12 | <div class="container"> | 12 | <div class="container"> |
13 | - <a class="navbar-brand" href="http://localhost:3000/main">묵호의 놀이터</a> | 13 | + <a class="navbar-brand" href="/main">묵호의 놀이터</a> |
14 | <div class="user"> | 14 | <div class="user"> |
15 | <a> <%= ID %> 님 안녕하세요 </section></a> | 15 | <a> <%= ID %> 님 안녕하세요 </section></a> |
16 | - <a class="btn btn-primary" href="http://localhost:3000/logout">로그아웃</a> | 16 | + <a class="btn btn-primary" href="/logout">로그아웃</a> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
19 | </nav> | 19 | </nav> | ... | ... |
... | @@ -19,9 +19,9 @@ | ... | @@ -19,9 +19,9 @@ |
19 | <!-- Navigation--> | 19 | <!-- Navigation--> |
20 | <nav class="navbar navbar-light bg-light static-top"> | 20 | <nav class="navbar navbar-light bg-light static-top"> |
21 | <div class="container"> | 21 | <div class="container"> |
22 | - <a class="navbar-brand" href="http://localhost:3000/">묵호의 놀이터</a> | 22 | + <a class="navbar-brand" href="/main">묵호의 놀이터</a> |
23 | <div class="user"> | 23 | <div class="user"> |
24 | - <a class="btn btn-primary" href="http://localhost:3000/register">회원가입</a> | 24 | + <a class="btn btn-primary" href="/register">회원가입</a> |
25 | </div> | 25 | </div> |
26 | </div> | 26 | </div> |
27 | </nav> | 27 | </nav> | ... | ... |
... | @@ -19,10 +19,10 @@ | ... | @@ -19,10 +19,10 @@ |
19 | <!-- Navigation--> | 19 | <!-- Navigation--> |
20 | <nav class="navbar navbar-light bg-light static-top"> | 20 | <nav class="navbar navbar-light bg-light static-top"> |
21 | <div class="container"> | 21 | <div class="container"> |
22 | - <a class="navbar-brand" href="http://localhost:3000/main">묵호의 놀이터</a> | 22 | + <a class="navbar-brand" href="/main">묵호의 놀이터</a> |
23 | <div class="user"> | 23 | <div class="user"> |
24 | <a> <%= ID %> 님 안녕하세요 </a> | 24 | <a> <%= ID %> 님 안녕하세요 </a> |
25 | - <a class="btn btn-primary" href="http://localhost:3000/logout">로그아웃</a> | 25 | + <a class="btn btn-primary" href="/logout">로그아웃</a> |
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | </nav> | 28 | </nav> | ... | ... |
... | @@ -19,9 +19,9 @@ | ... | @@ -19,9 +19,9 @@ |
19 | <!-- Navigation--> | 19 | <!-- Navigation--> |
20 | <nav class="navbar navbar-light bg-light static-top"> | 20 | <nav class="navbar navbar-light bg-light static-top"> |
21 | <div class="container"> | 21 | <div class="container"> |
22 | - <a class="navbar-brand" href="http://localhost:3000/">묵호의 놀이터</a> | 22 | + <a class="navbar-brand" href="/main">묵호의 놀이터</a> |
23 | <div class="user"> | 23 | <div class="user"> |
24 | - <a class="btn btn-primary" href="http://localhost:3000/login">로그인</a> | 24 | + <a class="btn btn-primary" href="/login">로그인</a> |
25 | </div> | 25 | </div> |
26 | </div> | 26 | </div> |
27 | </nav> | 27 | </nav> | ... | ... |
-
Please register or login to post a comment