первый коммит, надеюсь последний.
Сделанно: 1. минимально рабочий бэк 2. 2 модели 3. 1 миграция
This commit is contained in:
@@ -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
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user