blob: ee63748ca8397548ca45b27c4ee603c9267e841b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import express from 'express';
import { login_get, login_post } from '../controllers/root/login.js';
import { logout_get } from '../controllers/root/logout.js';
import { root_get } from '../controllers/root/root.js';
import bodyParser from '../middlewares/formParser.js';
import session from '../middlewares/sessions.js';
import { checkUsername, checkPassword } from '../utils/checks.js';
const router = express.Router();
router.use(session);
router.get('/', root_get);
router.get('/login', login_get);
router.post('/login', [bodyParser, checkUsername, checkPassword], login_post);
router.get('/logout', logout_get);
export default router;
|