const express = require('express');
const { register, login, getMe, createUser, logout } = require('../controllers/authController');
const { protect, admin } = require('../middleware/auth');

const router = express.Router();

router.post('/register', register);
router.post('/login', login);
router.post('/logout', protect, logout);
router.post('/users', protect, admin, createUser);
router.get('/me', protect, getMe);

module.exports = router;
