Showing
4 changed files
with
69 additions
and
2 deletions
... | @@ -2,8 +2,11 @@ var express = require('express'); | ... | @@ -2,8 +2,11 @@ var express = require('express'); |
2 | var router = express.Router(); | 2 | var router = express.Router(); |
3 | 3 | ||
4 | /* GET home page. */ | 4 | /* GET home page. */ |
5 | -router.get('/', function(req, res, next) { | 5 | +router.get('/', function (req, res, next) { |
6 | - res.render('index', { title: 'Express' }); | 6 | + res.render('/public/html/main', { title: 'My Gallery' }); |
7 | }); | 7 | }); |
8 | 8 | ||
9 | +router.get('/login', function (req, res, next) { | ||
10 | + res.render('index', { title: 'Express' }); | ||
11 | +}) | ||
9 | module.exports = router; | 12 | module.exports = router; | ... | ... |
routes/login.js
0 → 100644
1 | +var express = require('express'); | ||
2 | +var router = express.Router(); | ||
3 | +var fs = require('fs'); | ||
4 | +//로그인 페이지에서 실행됨 : title 할당하고 login.html 띄워줌. | ||
5 | +router.get('/login', function (req, res, next) { | ||
6 | + res.render('login.html', { title: 'Login2' }); | ||
7 | + var url = request.url; | ||
8 | + if (url == '/') { | ||
9 | + url = 'send.html'; | ||
10 | + } | ||
11 | + if (url == '/loginmainpage') { | ||
12 | + url = 'loginmainpage.html'; | ||
13 | + } | ||
14 | + response.writeHead(200); | ||
15 | + response.end(fs.readFileSync(__dirname + url)); | ||
16 | + console.log('로그인 페이지 접속 성공'); | ||
17 | +}); | ||
18 | +module.exports = router; |
routes/main.js
0 → 100644
1 | +var express = require('express'); | ||
2 | +var router = express.Router(); | ||
3 | + | ||
4 | +//루트 페이지 (메인페이지)에서 실행됨 : title 할당하고 main.html 띄워줌. | ||
5 | +router.get('/', function (req, res, next) { | ||
6 | + res.render('main.html', { title: 'Culture Gallery' }); | ||
7 | + console.log('main 접속 성공'); | ||
8 | +}); | ||
9 | + | ||
10 | +/* GET home page. */ | ||
11 | +router.get('/login', function (req, res, next) { | ||
12 | + res.render('login.html', { title: 'Login1' }); | ||
13 | + console.log('로그인 페이지 접속 성공'); | ||
14 | +}); | ||
15 | +module.exports = router; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
routes/send.js
0 → 100644
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 |
-
Please register or login to post a comment