송효섭

로그인 및 공유 router 수정, 공유기능 분리

function sendLink(){
Kakao.init('0678e32dab56db1c52ac63ab4ccb7663')
Kakao.Link.sendDefault({
objectType: 'feed',
content:{
title: "관심있는 공연 정보",
description: '주소-> http://naver.com',
imageUrl:'http://k.kakaocdn.net/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
link:{
mobileWebUrl: 'http://naver.com',
webUrl: 'http://naver.com',
},
},
buttons: [
{
title: '웹으로 보기',
link: {
mobileWebUrl: 'http://naver.com',
webUrl: 'http://naver.com',
},
},
{
title: '웹으로 보기',
link: {
mobileWebUrl: 'http://naver.com',
webUrl: 'http://naver.com',
},
},
],
})
};
\ No newline at end of file
......@@ -9,7 +9,17 @@ router.get('/', function (req, res, next) {
/* GET home page. */
router.get('/login', function (req, res, next) {
res.render('login.html', { title: 'Login1' });
res.render('login.html', { title: 'Login' });
console.log('로그인 페이지 접속 성공');
});
// router.get('/login/:id', function (req, res) {
// var id = req.params.id;
// console.log('id 할당 접속 성공');
// });
router.get('/send', function (req, res, next) {
res.render('send.html', { title: 'Send message' });
console.log('카카오톡 공유 메시지 접속 성공');
})
module.exports = router;
\ No newline at end of file
......
//index로 통합 되서 안 쓸 예정 --> merge 다 하면 삭제하기
var express = require('express');
var router = express.Router();
var fs = require('fs');
......@@ -8,9 +9,6 @@ router.get('/login', function (req, res, next) {
if (url == '/') {
url = 'send.html';
}
if (url == '/loginmainpage') {
url = 'loginmainpage.html';
}
response.writeHead(200);
response.end(fs.readFileSync(__dirname + url));
console.log('로그인 페이지 접속 성공');
......
......@@ -32,6 +32,7 @@
</header>
</body>
<script>
// 카카오 계정으로
Kakao.init('0678e32dab56db1c52ac63ab4ccb7663');
console.log(Kakao.isInitialized());
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>send page title</title>
<script src="https://developers.kakao.com/sdk/js/kakao.js"></script>
<script src="send.js"></script>
</head>
<body>
<a onclick="sendLink()">보내기</a>
</body>
<head>
<meta charset="utf-8" />
<title>send page title</title>
<script src="https://developers.kakao.com/sdk/js/kakao.js"></script>
<script src="../javascripts/send.js"></script>
</head>
<body>
<a onclick="sendLink()">보내기</a>
</body>
</html>
\ No newline at end of file
......