Toggle navigation
Toggle navigation
This project
Loading...
Sign in
teamPARK
/
holiday-counter-recommend-activity
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
박지환
2022-05-17 12:33:06 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c35dca9c49ab71e29f49df5d1d1cbcfbc0481c12
c35dca9c
1 parent
5aeb7f0e
Update get this month data
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
server.js
server.js
View file @
c35dca9
...
...
@@ -13,13 +13,11 @@ var operation = "getHoliDeInfo";
// Do not modify the values
var
SERVEICE_KEY
=
"qBtJy2Prw8CCnAiijUM7VkuaA9MZozHuiQI4FbEGYdUDPz4%2FM%2FuxegGjNBWK0aWQHvSslVHwIZQwNWh57WgRTA%3D%3D"
;
var
url
=
"http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/"
+
operation
;
var
url
=
"http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/"
;
var
queryParams
=
"?"
+
"solYear"
+
"="
+
year
;
queryParams
+=
"&"
+
"solMonth"
+
"="
+
month
;
queryParams
+=
"&"
+
"ServiceKey"
+
"="
+
SERVEICE_KEY
;
let
requestUrl
=
url
+
queryParams
;
let
requestUrl
=
url
+
operation
+
queryParams
;
// Empty variables
var
text
=
""
;
...
...
@@ -65,8 +63,23 @@ function getDate(dateName, locdate) {
return
dday
;
}
function
changeParams
(
year
,
month
,
operation
)
{
queryParams
=
"?"
+
"solYear"
+
"="
+
year
;
queryParams
+=
"&"
+
"solMonth"
+
"="
+
month
;
queryParams
+=
"&"
+
"ServiceKey"
+
"="
+
SERVEICE_KEY
;
requestUrl
=
url
+
operation
+
queryParams
;
}
// To initialize datas when calling webpage
function
init
()
{
// Intialize Year, Month
var
date
=
getTodayDate
().
split
(
"-"
);
year
=
date
[
0
];
month
=
date
[
1
];
operation
=
"getHoliDeInfo"
;
console
.
log
(
year
,
month
);
changeParams
(
year
,
month
,
operation
);
// Get data from holiday api
request
.
get
(
requestUrl
,
(
err
,
res
,
body
)
=>
{
if
(
err
)
{
console
.
log
(
"err => "
+
err
);
...
...
Please
register
or
login
to post a comment