Update src/server/server.js

main
Eyuep Sueyruege 2023-11-08 09:20:07 +01:00
parent 51daec2059
commit f13eb6a8cc
1 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,24 @@
var express = require("express")
var axios = require("axios")
var schedule = require("node-schedule")
// 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...');
});