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-06-07 00:11:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
783cc818e9b3f07007ba6649d60b0809117cdc4d
783cc818
1 parent
f36c35d0
Update server.js to prevent limiting daily traffic
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
nodejs/server.js
nodejs/server.js
View file @
783cc81
...
...
@@ -23,6 +23,7 @@ var text = "";
var
dateName
=
[];
var
locdate
=
[];
var
tempArr
=
[];
var
todayDate
=
""
;
// To run EJS engine
app
.
set
(
"views"
,
__dirname
+
"/views"
);
...
...
@@ -36,7 +37,6 @@ function getTodayDate() {
var
month
=
(
"0"
+
(
today
.
getMonth
()
+
1
)).
slice
(
-
2
);
var
day
=
(
"0"
+
today
.
getDate
()).
slice
(
-
2
);
var
dateString
=
year
+
"-"
+
month
+
"-"
+
day
;
//return "2022-12-25"; // 테스트용 날짜를 입력하세요. *** 테스트가 끝나면 주석처리하고 커밋해주세요. *** ex) 2022-09-12, 2022-09-15, 2022-10-04
return
dateString
;
}
...
...
@@ -165,14 +165,19 @@ function getData() {
// To initialize datas when calling webpage
function
init
()
{
// Intialize Year, Month
var
date
=
getTodayDate
().
split
(
"-"
);
year
=
date
[
0
];
month
=
date
[
1
];
operation
=
"getRestDeInfo"
;
changeParams
(
year
,
month
,
operation
);
// Get data from holiday api
getData
();
// To get now date
var
tempDate
=
getTodayDate
();
if
(
tempDate
!=
todayDate
)
{
// Intialize Year, Month
todayDate
=
tempDate
;
var
date
=
todayDate
.
split
(
"-"
);
year
=
date
[
0
];
month
=
date
[
1
];
operation
=
"getRestDeInfo"
;
changeParams
(
year
,
month
,
operation
);
// Get data from holiday api
getData
();
}
}
// Get request for web service
...
...
Please
register
or
login
to post a comment