first commit
This commit is contained in:
17
app/server.js
Normal file
17
app/server.js
Normal 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();
|
||||
});
|
||||
Reference in New Issue
Block a user