aboutsummaryrefslogtreecommitdiff
path: root/auth/index.js
blob: b726a255d346e63e5d8f84f1fdcc5a7e37e052f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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", async (req, res) => {
    const users = await db.query("SELECT id, name, middlename, surname FROM users");
    res.json(users);
});

module.exports = app;