use axum::Router;
use axum::routing::{get, post};
use crate::routes::{self, method_not_allowed};
use crate::state::AppState;
pub fn router() -> Router<AppState> {
Router::new()
.route(
"/v1/scrape",
post(routes::scrape::scrape).fallback(method_not_allowed),
)
.route(
"/v1/crawl",
post(routes::crawl::start_crawl).fallback(method_not_allowed),
)
.route(
"/v1/crawl/{id}",
get(routes::crawl::get_crawl)
.delete(routes::crawl::cancel_crawl)
.fallback(method_not_allowed),
)
.route(
"/v1/map",
post(routes::map::map).fallback(method_not_allowed),
)
.route(
"/v1/search",
post(routes::search::search).fallback(method_not_allowed),
)
.route(
"/v1/capabilities",
get(routes::capabilities::capabilities).fallback(method_not_allowed),
)
.route(
"/v1/change-tracking/diff",
post(routes::change_tracking::diff).fallback(method_not_allowed),
)
}