From bda5305e995023d8c2382754d9761ac92a76db88 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 30 Sep 2020 22:56:00 +0200 Subject: Started authentication --- app.js | 2 ++ auth/index.js | 14 ++++++++++++++ auth/public/index.html | 9 +++++++++ tables.sql | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 auth/index.js create mode 100644 auth/public/index.html diff --git a/app.js b/app.js index 1130de1..a527074 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,7 @@ require("dotenv").config(); const express = require("express"); const motto = require("./motto"); +const auth = require("./auth"); const app = express(); @@ -10,5 +11,6 @@ app.use(express.json()); app.get("/", (req, res) => res.redirect("/motto")); app.use("/motto", motto); +app.use("/auth", auth); app.listen(5005, () => console.log("Server started on http://localhost:5005")); diff --git a/auth/index.js b/auth/index.js new file mode 100644 index 0000000..9bc3f58 --- /dev/null +++ b/auth/index.js @@ -0,0 +1,14 @@ +const express = require("express"); +const db = require("../db"); +const app = express.Router(); + +// TODO: Name list parser (teachers + pupils) +// TODO: Add users (OTP) +// TODO: Change passwords +// TODO: Login (+ Frontend, cookie, etc) + +app.use("/", express.static(__dirname + "/public")); + +app.get("/api/list", (req, res) => {}); + +module.exports = app; diff --git a/auth/public/index.html b/auth/public/index.html new file mode 100644 index 0000000..c290ab0 --- /dev/null +++ b/auth/public/index.html @@ -0,0 +1,9 @@ + + +
+ + +