Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
SOD/routes/admin/index.js

19 lines
607 B
JavaScript

let express = require("express");
let router = express.Router();
let sessionCheck = require("../../middlewares/sessionCheck");
let models = require("../../models");
router.get("/", sessionCheck(3), async (req, res) => {
res.render("admin/index", {
title: "SOD - Administration",
sandwiches: await models.Sandwich.findAll(),
users: await models.User.findAll()
});
})
.use("/orders", require("./orders"))
.use("/sandwiches", require("./sandwiches"))
.use("/departments", require("./departments"))
.use("/users", require("./users"));
module.exports = router;