Suyeon Jung

Modify select view

...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
17 "xhr": "^2.5.0", 17 "xhr": "^2.5.0",
18 "xmlhttprequest": "^1.8.0" 18 "xmlhttprequest": "^1.8.0"
19 } 19 }
20 -}
...\ No newline at end of file ...\ No newline at end of file
20 +}
......
1 var express = require('express'); 1 var express = require('express');
2 var router = express.Router(); 2 var router = express.Router();
3 +var request = require('request');
3 4
4 /* GET home page. */ 5 /* GET home page. */
5 6
6 router.post('/', function(req, res) { 7 router.post('/', function(req, res) {
8 + let kakaoOptions = {
9 + url: 'https://dapi.kakao.com/v2/local/search/address.json?query=잠실역',
10 + method: 'GET',
11 + headers: {
12 + 'Authorization': 'KakaoAK 4803a487ea1fb1646e4a8dd8c002ad7d'
13 + },
14 + // qs: {
15 + // query: '잠실역'
16 + // },
17 + encoding: 'UTF-8',
18 + }
19 + request(kakaoOptions, function(err, res, body) {
20 + if (!err && res.statusCode == 200) {
21 + console.log(JSON.parse(body));
22 + }
23 + })
7 res.render('select', { 'si': req.body.si, 'ku': req.body.ku }); 24 res.render('select', { 'si': req.body.si, 'ku': req.body.ku });
8 }); 25 });
9 26
......
1 -//- doctype html 1 +doctype html
2 html 2 html
3 head 3 head
4 if location =="n" 4 if location =="n"
5 button k 5 button k
6 body 6 body
7 block content 7 block content
8 - h1 #{si} 8 + h1 당신의 동네 : #{si} #{ku}
9 - h1 #{ku} 9 + .row
10 + .col.s12.m7
11 + .card(style='background-color: skyblue; display: inline-block;')
12 + .card-image
13 + img(src='/restaurant.jpg' style='width:400px; height: 300px;')
14 + h1.card-title 음식
15 + .card-content
16 + p
17 + | 주변 동네 맛집의 개수와 얼마나 다양한 음식점이 있는지
18 + .card-action
19 + a(href='#') 검사!
20 +
21 + .card(style='background-color: skyblue; display: inline-block;')
22 + .card-image
23 + img(src='/school.jpg' style='width:400px; height: 300px;')
24 + h1.card-title 학군
25 + .card-content
26 + p
27 + | 주변 학교, 학원 환경
28 + .card-action
29 + a(href='#') 검사!
30 +
31 + .card(style='background-color: skyblue; display: inline-block;')
32 + .card-image
33 + img(src='/park.jpg' style='width:400px; height: 300px;')
34 + h1.card-title 공원
35 + .card-content
36 + p
37 + | 주변 공원
38 + .card-action
39 + a(href='#') 검사!
40 +
41 + .card(style='background-color: skyblue; display: inline-block;')
42 + .card-image
43 + img(src='/public_transport.jpg' style='width:400px; height: 300px;')
44 + h1.card-title 대중교통
45 + .card-content
46 + p
47 + | 대중교통 편리도
48 + .card-action
49 + a(href='#') 검사!
50 +
51 + .card(style='background-color: skyblue; display: inline-block;')
52 + .card-image
53 + img(src='/safe.jpg' style='width:400px; height: 300px;')
54 + h1.card-title 안전
55 + .card-content
56 + p
57 + | 주변 경찰서, 범죄자 인근~~
58 + .card-action
59 + a(href='#') 검사!
60 +
61 + .card(style='background-color: skyblue; display: inline-block;')
62 + .card-image
63 + img(src='/cultural_life.jpg' style='width:400px; height: 300px;')
64 + h1.card-title 여가
65 + .card-content
66 + p
67 + | 문화생활 시설
68 + .card-action
69 + a(href='#') 검사!
10 70
......