ips/pkg6depotd/src/http/server.rs
Till Wegmueller cd15e21420
Add repository handling and foundational HTTP routes for pkg6depotd
- 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.
2025-12-08 20:50:20 +01:00

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()))
}