Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zuzitsu
/
UR_Village
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
Suyeon Jung
2020-12-07 07:07:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1aba41a8c005095e0432bdd233554949f8c5bc13
1aba41a8
1 parent
1de5514a
Complete culture category
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletions
routes/category.js
views/culture_result.ejs
routes/category.js
View file @
1aba41a
...
...
@@ -336,7 +336,28 @@ router.get('/safe', function(req, res) {
});
router
.
get
(
'/culture'
,
function
(
req
,
res
)
{
res
.
send
(
'This is culture'
);
// 노래방
let
sing_url
=
'https://openapi.gg.go.kr/Songclub'
;
let
qs
=
`?Type=json&KEY=
${
GYEONGI_API_KEY
}
&SIGUN_CD=
${
SIGUN_CODE
}
`
;
request
({
url
:
sing_url
+
qs
,
method
:
'GET'
},
function
(
err
,
response
,
body
)
{
if
(
!
err
&&
res
.
statusCode
==
200
)
{
let
sing_result
=
JSON
.
parse
(
body
);
console
.
log
(
sing_result
);
let
sings
=
[];
for
(
let
i
=
0
;
i
<
sing_result
.
Songclub
[
1
].
row
.
length
;
i
++
)
{
sing
=
sing_result
.
Songclub
[
1
].
row
[
i
];
// 폐업인 지점 제외
if
(
!
sing
[
'BSN_STATE_NM'
].
includes
(
'폐업'
))
{
console
.
log
(
'sing'
,
sing
);
sings
.
push
(
sing
);
}
}
res
.
render
(
'culture_result'
,
{
sings
:
sings
});
}
});
});
router
.
get
(
'/shop'
,
function
(
req
,
res
)
{
...
...
views/culture_result.ejs
0 → 100644
View file @
1aba41a
<!DOCTYPE html>
<html
lang=
"ko"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
✍️ 결과 페이지
</title>
</head>
<body>
<h1>
🎤 노래방 현황
</h1>
<
%for (var i =0; i
<sings
.
length
;
i
++){%
>
<li>
<
%=sings[i].BIZPLC_NM%>
</li>
<
%}%>
<h3>
총 노래방 개수 :
<
%=sings.length%>
</h3>
</body>
</html>
\ No newline at end of file
Please
register
or
login
to post a comment