Fix routes
This commit is contained in:
parent
755fce2f7f
commit
4bc5d00344
6 changed files with 8 additions and 15 deletions
2
app.js
2
app.js
|
@ -9,7 +9,6 @@ let config = process.env.NODE_ENV === "test" ? {} : require("./config/config.jso
|
|||
let indexRouter = require("./routes/index");
|
||||
const loginRouter = require("./routes/login");
|
||||
const edtRouter = require("./routes/edt");
|
||||
const homeRouter = require("./routes/home");
|
||||
const marksRouter = require("./routes/marks");
|
||||
const registerRouter = require("./routes/register");
|
||||
const viescolRouter = require("./routes/viescol");
|
||||
|
@ -41,7 +40,6 @@ app.use("/", indexRouter);
|
|||
app.use("/login", loginRouter);
|
||||
app.use("/email", require("./routes/email"));
|
||||
app.use("/edt", edtRouter);
|
||||
app.use("/home", homeRouter);
|
||||
app.use("/marks", marksRouter);
|
||||
app.use('/register', registerRouter);
|
||||
app.use('/viescol', viescolRouter);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const express = require("express");
|
||||
const sessionCheck = require("./utils/sessionCheck");
|
||||
const router = express.Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
router.get("/", sessionCheck(1), (req, res) => {
|
||||
res.render("pages/edt", { title: "L'ETU" });
|
||||
});
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
const express = require("express");
|
||||
const router = express.Router();
|
||||
|
||||
/* GET home page. */
|
||||
router.get("/", (req, res) => {
|
||||
res.render("pages/home", { title: "L'ETU" });
|
||||
});
|
||||
|
||||
module.exports = router;
|
|
@ -1,7 +1,8 @@
|
|||
const express = require("express");
|
||||
const sessionCheck = require("./utils/sessionCheck");
|
||||
const router = express.Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
router.get("/", sessionCheck(1), (req, res) => {
|
||||
res.render("pages/marks", { title: "L'ETU" });
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const express = require("express");
|
||||
const sessionCheck = require("./utils/sessionCheck");
|
||||
const router = express.Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
router.get("/", sessionCheck(1), (req, res) => {
|
||||
res.render("pages/profil", { title: "L'ETU" });
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const express = require("express");
|
||||
const sessionCheck = require("./utils/sessionCheck");
|
||||
const router = express.Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
router.get("/", sessionCheck(1), (req, res) => {
|
||||
res.render("pages/viescol", { title: "L'ETU" });
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue