text: import express from "express";
  const router = express.Router();
  import {
    loginUser,
    registerUser,
    getUserProfile,
    updateUserProfile,
    getUsers,
    deleteUser,
    getUserById,
    updateUserById,
  } from "../controllers/userController.js";
  import { protect, admin } from "../middlewares/authMiddleware.js";
  
  router.route("/login").post(loginUser);
  router.route("/register").post(registerUser);
  router
    .route("/profile")
    .get(protect, getUserProfile)
    .put(protect, updateUserProfile);
  
  router.route("/").get(protect, admin, getUsers);
  router
    .route("/:id")
    .get(protect, admin, getUserById)
    .put(protect, admin, updateUserById)
    .delete(protect, admin, deleteUser);
  
  export default router;
  