♻️ Refactor backend

This commit is contained in:
2022-11-16 19:03:32 +01:00
parent 3666492e90
commit 568bfb9782
5 changed files with 74 additions and 70 deletions

View File

@ -9,7 +9,7 @@ import {
getHistory,
getClasses,
} from "./api/index.js";
import { Auth } from "./api/auth.js";
import auth from "./api/auth.js";
import { Parser } from "./parser/index.js";
// Check DSB Mobile credentials are supplied
@ -34,7 +34,6 @@ new Parser(
);
// Create new Auth class to store sessions
const auth = new Auth();
app.post("/login", auth.login);
// Check login for every API request
app.use("/api", auth.checkLogin);