// routes/userRoutes.js
const express = require('express');
const router  = express.Router();
const {
  signup,
  signin,
  getUserProfile,
  getAllUsers
} = require('../controllers/userController');
const { protect, admin } = require('../middleware/auth');

router.post('/signup', signup);
router.post('/signin', signin);

// Profile route (any authenticated user)
router.get('/profile', protect, getUserProfile);

// Get all users (admin only)
router.get('/', protect, admin, getAllUsers);

module.exports = router;