Created
January 11, 2023 14:39
-
-
Save jhaashutosh/20c80621f423f2638c48dd681a7a00bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const { | |
getUnits, | |
getUnitById, | |
addInstitute, | |
deleteInstitute, | |
editInstitute, | |
} = require("../controllers/unitController"); | |
const { protectRoute } = require("../middleware/authMiddleware"); | |
const router = express.Router(); | |
router | |
.route("/") | |
.get(protectRoute, getUnits) | |
.post(protectRoute, addInstitute) | |
.delete(protectRoute, deleteInstitute) | |
.put(protectRoute, editInstitute); | |
router.get("/:id", protectRoute, getUnitById); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment