Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hyunjong Lee
/
YTMT
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
Akhidjon
2019-05-31 17:53:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
934c04abae75d32ee0a076a0219ecd8846b06f9a
934c04ab
1 parent
2fa1182b
Setting up routes
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
3 deletions
app.js
routes/index.js
routes/login.js
views/index.ejs
app.js
View file @
934c04a
...
...
@@ -47,6 +47,7 @@ var mytoons = require('./routes/mytoons');
var
yourtoons
=
require
(
'./routes/yourtoons'
);
var
setting
=
require
(
'./routes/setting'
);
// 최초 로그인 성공시 (Strategy 성공시) 단 한번만 호출
passport
.
serializeUser
(
function
(
user
,
done
)
{
console
.
log
(
'serialized'
);
...
...
@@ -97,6 +98,7 @@ app.use('/users', users);
app
.
use
(
'/mytoons'
,
mytoons
);
app
.
use
(
'/setting'
,
setting
);
app
.
use
(
'/yourtoons'
,
yourtoons
);
app
.
use
(
'/login'
,
require
(
'./routes/login'
))
// added new login page
// catch 404 and forward to error handler, for wrong page
app
.
use
(
function
(
req
,
res
,
next
)
{
...
...
routes/index.js
View file @
934c04a
...
...
@@ -125,6 +125,11 @@ function loginByThirdparty(info, done) {
});
}
router
.
get
(
'/login'
,
function
(
req
,
res
){
res
.
render
(
'login_page'
)
})
// 라우터 설정, 카카오
router
.
get
(
'/auth/logout/kakao'
,
function
(
req
,
res
)
{
req
.
logout
();
...
...
routes/login.js
0 → 100644
View file @
934c04a
var
express
=
require
(
'express'
);
var
cheerio
=
require
(
'cheerio'
);
var
request
=
require
(
'request'
);
var
mysql
=
require
(
'mysql'
);
var
client
=
require
(
'cheerio-httpcli'
);
var
passport
=
require
(
'passport'
);
var
KakaoStrategy
=
require
(
'passport-kakao'
).
Strategy
;
var
NaverStrategy
=
require
(
'passport-naver'
).
Strategy
;
var
GoogleStrategy
=
require
(
'passport-google-oauth'
).
OAuth2Strategy
;
var
router
=
express
.
Router
();
router
.
get
(
'/login'
,
(
req
,
res
)
=>
res
.
render
(
'login_page'
));
module
.
exports
=
router
;
views/index.ejs
View file @
934c04a
...
...
@@ -47,9 +47,7 @@
<ul
class=
"nav navbar-nav navbar-right"
>
<li><a
href=
"#about"
class=
"page-scroll"
>
About
</a></li>
<li><a
href=
"#portfolio"
class=
"page-scroll"
>
Webtoons
</a></li>
<li><a
href=
"/auth/login/kakao"
class=
"page-scroll"
>
kakaoLogin
</a></li>
<li><a
href=
"/auth/login/naver"
class=
"page-scroll"
>
naverLogin
</a></li>
<li><a
href=
"/auth/login/google"
class=
"page-scroll"
>
googleLogin
</a></li>
<li><a
href=
"/login"
class=
"page-scroll"
>
Login
</a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
...
...
Please
register
or
login
to post a comment