feat: add repo validation

This commit is contained in:
2026-01-20 15:58:10 -08:00
parent 856bde3d97
commit 43c9b7c238
8 changed files with 83 additions and 23 deletions

View File

@@ -3,6 +3,7 @@ mod endpoints;
mod error;
mod middleware;
mod user;
mod validate;
use std::env;
@@ -72,18 +73,23 @@ async fn run() -> std::io::Result<()> {
)
.service(
web::scope("/api").service(
web::scope("/v0").service(
web::scope("/user")
.route("/repos", web::get().to(endpoints::get_repos::get_repos))
.wrap(from_fn(middleware::protected))
.route(
"/repos/search",
web::get().to(endpoints::search_repos::search_repos),
)
.wrap(from_fn(middleware::protected))
.route("/repo/add", web::post().to(endpoints::add_repo::add_repo))
.wrap(from_fn(middleware::protected)),
),
web::scope("/v0")
.service(
web::scope("/user")
.route("/repos", web::get().to(endpoints::get_repos::get_repos))
.wrap(from_fn(middleware::protected))
.route(
"/repos/search",
web::get().to(endpoints::search_repos::search_repos),
)
.wrap(from_fn(middleware::protected))
.route("/repo/add", web::post().to(endpoints::add_repo::add_repo))
.wrap(from_fn(middleware::protected)),
)
.route(
"/repos",
web::get().to(endpoints::global_repos::global_repos),
),
),
)
})