🛂 Add key-based permission system
This commit is contained in:
@ -8,6 +8,9 @@ import {
|
||||
getSubstitutions,
|
||||
getHistory,
|
||||
getClasses,
|
||||
getInfo,
|
||||
putKey,
|
||||
deleteKey,
|
||||
} from "./api/index.js";
|
||||
import auth from "./api/auth.js";
|
||||
import { Parser } from "./parser/index.js";
|
||||
@ -30,6 +33,7 @@ const port = process.env.PORT || 3000;
|
||||
app.use(cors());
|
||||
app.use(cookieParser());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.json());
|
||||
|
||||
// Initialize the Parser and set it to update the
|
||||
// substitution plan at the specified update interval
|
||||
@ -55,6 +59,9 @@ app.get("/api/check", (_req, res) => {
|
||||
});
|
||||
|
||||
// Register API endpoints
|
||||
app.get("/api/info", getInfo);
|
||||
app.put("/api/key", putKey);
|
||||
app.delete("/api/key", deleteKey);
|
||||
app.get("/api/timetable", getTimetable);
|
||||
app.get("/api/substitutions", getSubstitutions);
|
||||
app.get("/api/history", getHistory);
|
||||
|
Reference in New Issue
Block a user