use crate::controller::{AuthController, UserController};
use actix_web::web;

pub fn config(cfg: &mut web::ServiceConfig) {
    cfg.service(
        web::scope("/api/v1")
            .service(
                web::resource("/users")
                    .get(UserController::list_users)
                    .post(UserController::create_user),
            )
            .service(web::resource("/users/{user_id}"))
            .service(web::scope("/auth").route("/login", web::post().to(AuthController::login))),
    );
}
