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-13 12:14:23 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
a0b469c622b46f1639a908a4dea05a044eb430b4
a0b469c6
2 parents
50abebc7
04384667
Merge remote-tracking branch 'origin/master' into feature/holiday-counter
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
.gitignore
server.js
.gitignore
0 → 100644
View file @
a0b469c
holi.json
holi.xml
\ No newline at end of file
server.js
View file @
a0b469c
...
...
@@ -31,7 +31,7 @@ var tempArr = [];
app
.
set
(
"views"
,
__dirname
+
"/views"
);
app
.
set
(
"view engine"
,
"ejs"
);
app
.
get
(
"/"
,
function
(
req
,
res
)
{
function
init
(
)
{
request
.
get
(
requestUrl
,
(
err
,
res
,
body
)
=>
{
if
(
err
)
{
console
.
log
(
"err => "
+
err
);
...
...
@@ -84,6 +84,10 @@ app.get("/", function (req, res) {
}
}
});
}
app
.
get
(
"/"
,
function
(
req
,
res
)
{
init
();
// Send data from nodejs to ejs
res
.
render
(
"data.ejs"
,
{
data
:
tempArr
},
function
(
err
,
html
)
{
if
(
err
)
{
...
...
@@ -95,5 +99,7 @@ app.get("/", function (req, res) {
res
.
sendFile
(
__dirname
+
"/views/data.ejs"
);
});
init
();
const
port
=
8080
;
app
.
listen
(
port
,
()
=>
console
.
log
(
"Listening on port "
+
port
));
...
...
Please
register
or
login
to post a comment