Add classes table and API enpoint

This commit is contained in:
2022-05-01 23:35:21 +02:00
parent a47d913d6f
commit 078d9f6c66
3 changed files with 26 additions and 1 deletions

View File

@ -1,5 +1,10 @@
import express from "express";
import { getTimetable, getSubstitutions, getHistory } from "./api/index.js";
import {
getTimetable,
getSubstitutions,
getHistory,
getClasses,
} from "./api/index.js";
const app = express();
const port = process.send.PORT || 3000;
@ -7,6 +12,7 @@ const port = process.send.PORT || 3000;
app.get("/api/timetable", getTimetable);
app.get("/api/substitutions", getSubstitutions);
app.get("/api/history", getHistory);
app.get("/api/classes", getClasses);
app.get("/api/*", (req, res) => {
res.sendStatus(400);
});