const express = require("express");
const router = express.Router();
const usersController = require("../controllers/usersController");
const { checkLogin } = require("../services/userService");

// Route for getting all users
router.get("/users", usersController.getAllUsers);

// Route for getting a specific user by ID
router.get("/users/:id", usersController.getUserById);

// Route for creating a new user
router.post("/users", usersController.createUser);

// Route for updating a user by ID
router.put("/users/:id", usersController.updateUser);

// Route for deleting a user by ID
router.delete("/users/:id", usersController.deleteUser);

//Route for checking user credentials
router.post("/users/login", usersController.checkLogin);

module.exports = router;
