Mukho

Update href

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