Skip to content

Instantly share code, notes, and snippets.

@jhaashutosh
Created January 11, 2023 14:39
Show Gist options
  • Save jhaashutosh/20c80621f423f2638c48dd681a7a00bd to your computer and use it in GitHub Desktop.
Save jhaashutosh/20c80621f423f2638c48dd681a7a00bd to your computer and use it in GitHub Desktop.
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