первый коммит, надеюсь последний.

Сделанно:
1. минимально рабочий бэк
2. 2 модели
3. 1 миграция
This commit is contained in:
2023-07-09 17:35:12 +07:00
commit a059bcb196
19 changed files with 2290 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
const { authJwt } = require("../middleware");
const controller = require("../controllers/user.controller");
module.exports = function(app) {
app.use(function(req, res, next) {
res.header(
"Access-Control-Allow-Headers",
"x-access-token, Origin, Content-Type, Accept"
);
next();
});
app.get("/api/get/all", controller.allAccess);
app.get(
"/api/get/user",
[authJwt.verifyToken],
controller.userBoard
);
app.get(
"/api/get/mod",
[authJwt.verifyToken, authJwt.isModerator],
controller.moderatorBoard
);
app.get(
"/api/get/admin",
[authJwt.verifyToken, authJwt.isAdmin],
controller.adminBoard
);
};