송효섭

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

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