first commit

This commit is contained in:
ChKendel
2026-02-15 21:44:57 +01:00
committed by chk
parent 05314ce961
commit 58b490b4f1
12 changed files with 263 additions and 0 deletions

17
app/server.js Normal file
View File

@@ -0,0 +1,17 @@
const express = require("express");
const pool = require("./db");
const scheduleChecks = require("./scheduler");
const app = express();
app.set("view engine", "ejs");
app.use(express.static("public"));
app.get("/", async (req, res) => {
const { rows } = await pool.query("SELECT * FROM checks ORDER BY id");
res.render("index", { checks: rows });
});
app.listen(3000, async () => {
console.log("Server läuft auf Port 3000");
await scheduleChecks();
});