Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이진아
/
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
강현태
2017-12-03 01:49:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a6ec4ad44d36074f850585a170da4a1910076b8f
a6ec4ad4
1 parent
d9cb3dd0
mytoons 추가
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
4 deletions
.idea/workspace.xml
app.js
routes/index.js
routes/mytoons.js
views/index.ejs
views/mytoons.ejs
.idea/workspace.xml
View file @
a6ec4ad
This diff is collapsed. Click to expand it.
app.js
View file @
a6ec4ad
...
...
@@ -9,6 +9,7 @@ var cheerio = require('cheerio');
var
request
=
require
(
'request'
);
var
index
=
require
(
'./routes/index'
);
var
users
=
require
(
'./routes/users'
);
var
mytoons
=
require
(
'./routes/mytoons'
);
var
app
=
express
();
...
...
@@ -26,7 +27,9 @@ app.use(express.static(path.join(__dirname, 'public')));
app
.
use
(
'/'
,
index
);
app
.
use
(
'/users'
,
users
);
app
.
use
(
express
.
static
(
'views'
));
app
.
use
(
'/mytoons'
,
mytoons
);
//app.use(express.static('views'));
// catch 404 and forward to error handler
app
.
use
(
function
(
req
,
res
,
next
)
{
...
...
routes/index.js
View file @
a6ec4ad
...
...
@@ -38,6 +38,7 @@ router.get('/', function(req, res, next) {
title
:
'니툰내툰'
,
list
:
allWebtoons
});
});
...
...
routes/mytoons.js
0 → 100644
View file @
a6ec4ad
var
express
=
require
(
'express'
);
var
cheerio
=
require
(
'cheerio'
);
var
request
=
require
(
'request'
);
var
router
=
express
.
Router
();
/* GET home page. */
router
.
get
(
'/'
,
function
(
req
,
res
,
next
)
{
res
.
render
(
'mytoons'
);
});
module
.
exports
=
router
;
\ No newline at end of file
views/index.ejs
View file @
a6ec4ad
...
...
@@ -9,7 +9,6 @@
<p>
웹툰 리스트
</p>
<a
id=
"kakao-login-btn"
></a>
<a
id=
"kakao-logout-btn"
href=
"javascript:logout();"
>
로그아웃
</a>
<a
id=
"save_config"
>
저장
</a>
<table>
...
...
@@ -51,6 +50,7 @@
// 카카오 로그인 버튼을 생성합니다.
Kakao
.
Auth
.
getStatus
(
function
(
statusObj
){
if
(
statusObj
.
status
==
'connected'
){
location
.
href
=
"./mytoons"
;
document
.
getElementById
(
'kakao-login-btn'
).
setAttribute
(
'style'
,
'display: none;'
);
}
else
{
document
.
getElementById
(
'kakao-logout-btn'
).
setAttribute
(
'style'
,
'display: none;'
);
...
...
@@ -62,11 +62,11 @@
container
:
'#kakao-login-btn'
,
size
:
'small'
,
success
:
function
(
authObj
)
{
alert
(
JSON
.
stringify
(
authObj
));
//
alert(JSON.stringify(authObj));
location
.
reload
();
},
fail
:
function
(
err
)
{
alert
(
JSON
.
stringify
(
err
)
);
alert
(
"로그인 실패!"
);
}
});
...
...
views/mytoons.ejs
0 → 100644
View file @
a6ec4ad
<!DOCTYPE html>
<html>
<head>
<title>
내툰
</title>
<link
rel=
'stylesheet'
href=
'/stylesheets/style.css'
/>
<script
src=
"http://developers.kakao.com/sdk/js/kakao.min.js"
></script>
</head>
<h1>
내툰
</h1>
<p>
추가한 리스트
</p>
<a
id=
"kakao-login-btn"
></a>
<a
id=
"kakao-logout-btn"
href=
"javascript:logout();"
>
로그아웃
</a>
<a
id=
"save_config"
>
저장
</a>
<table>
</table>
</br>
<script
type=
'text/javascript'
>
//<![CDATA[
// 사용할 앱의 JavaScript 키를 설정해 주세요.
Kakao
.
init
(
'602377cd7aa60a82eeebda466560f3e5'
);
// 카카오 로그인 버튼을 생성합니다.
Kakao
.
Auth
.
getStatus
(
function
(
statusObj
){
if
(
statusObj
.
status
==
'connected'
){
document
.
getElementById
(
'kakao-login-btn'
).
setAttribute
(
'style'
,
'display: none;'
);
}
else
{
alert
(
"로그인 해주세요!"
);
location
.
href
=
"/"
;
document
.
getElementById
(
'kakao-logout-btn'
).
setAttribute
(
'style'
,
'display: none;'
);
document
.
getElementById
(
'save_config'
).
setAttribute
(
'style'
,
'display: none;'
);
}
});
Kakao
.
Auth
.
createLoginButton
({
container
:
'#kakao-login-btn'
,
size
:
'small'
,
success
:
function
(
authObj
)
{
location
.
reload
();
},
fail
:
function
(
err
)
{
alert
(
"로그인 실패!"
);
}
});
function
logout
(){
Kakao
.
Auth
.
logout
(
function
()
{
location
.
reload
();
});
}
//]]>
</script>
</body>
</html>
Please
register
or
login
to post a comment