mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 21:30:41 +00:00
- Implemented `DepotRepo` for repository access, including methods for catalog path, file path, and manifest retrieval. - Introduced foundational HTTP routes for catalog, manifest, file, and package info retrieval. - Added integration tests to validate repository setup and basic server functionality. - Modularized HTTP handlers for better maintainability and extended them with new implementations like `info` and `manifest` handling. - Refactored `main` function to simplify initialization and leverage reusable `run` logic in a new `lib.rs`. - Updated `Cargo.toml` and `Cargo.lock` to include new dependencies: `walkdir` and updated testing utilities.
10 lines
340 B
Rust
10 lines
340 B
Rust
use tokio::net::TcpListener;
|
|
use axum::Router;
|
|
use crate::errors::Result;
|
|
|
|
pub async fn run(router: Router, listener: TcpListener) -> Result<()> {
|
|
let addr = listener.local_addr()?;
|
|
tracing::info!("Listening on {}", addr);
|
|
|
|
axum::serve(listener, router).await.map_err(|e| crate::errors::DepotError::Server(e.to_string()))
|
|
}
|