박종현

Merge remote-tracking branch 'origin/master' into feature/holiday-counter

holi.json
holi.xml
\ No newline at end of file
......@@ -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));
......