From f13eb6a8cc6c53948fb6edbfb65781af0e886978 Mon Sep 17 00:00:00 2001 From: Eyuep Sueyruege Date: Wed, 8 Nov 2023 09:20:07 +0100 Subject: [PATCH] Update src/server/server.js --- src/server/server.js | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/server/server.js b/src/server/server.js index 0991f6b..bae76b2 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -1,3 +1,24 @@ -var express = require("express") -var axios = require("axios") -var schedule = require("node-schedule") \ No newline at end of file +// imports +const express = require('express'); +const http = require('http'); +const schedule = require('node-schedule'); +const axios = require('axios'); +const app = express(); + +// Shedule Format (* * * * *) (Sec(0-59), Min(0-59), Hours(0-23), Day (1-31), Month (0-11)) + + +const job = schedule.scheduleJob('*/15 * * * *', () => { + const clientURL = 'http://localhost:80'; + +axios.get(clientURL) + .then((response) => { + }) + .catch((error) => { + }); + }); + +// Port Definition +app.listen(3000, () => { + console.log('Backend-Server running on port 3000...'); +});