docs: add doc strings and README info

This commit is contained in:
Sandro Eiler 2024-01-30 16:19:19 +01:00
parent f2552a74ed
commit 1fdf2948fb
3 changed files with 16 additions and 0 deletions

View file

@ -29,3 +29,13 @@ Current contribution workflow is:
2. Use `cz c` to add a commit
3. Push changes
4. Open pull/merge request
## Maintainance
**Versioning:**
TODO; explain versioning
**Check for unused dependencies:**
```sh
cargo +nightly udeps --all-targets
```

View file

@ -4,6 +4,7 @@ use sqlx::PgPool;
use tokio::net::TcpListener;
#[tokio::main]
/// Entry point for the application.
async fn main() {
let configuration = get_configuration().expect("Failed to read configuration.");
let addr = format!("127.0.0.1:{}", configuration.application_port);

View file

@ -5,6 +5,8 @@ use sqlx::PgPool;
use tokio::net::TcpListener;
/// API routing
///
/// * `connection`: The postgres connection pool
pub fn app(connection: PgPool) -> Router {
Router::new()
.merge(crate::routes::routes_health_check())
@ -12,6 +14,9 @@ pub fn app(connection: PgPool) -> Router {
}
/// Start the server
///
/// * `listener`: The TCP listener
/// * `connection`: The postgres connection pool
pub fn run(listener: TcpListener, connection: PgPool) -> Serve<IntoMakeService<Router>, Router> {
axum::serve(listener, app(connection).into_make_service())
}