docs: add doc strings and README info
This commit is contained in:
parent
f2552a74ed
commit
1fdf2948fb
3 changed files with 16 additions and 0 deletions
10
README.md
10
README.md
|
|
@ -29,3 +29,13 @@ Current contribution workflow is:
|
||||||
2. Use `cz c` to add a commit
|
2. Use `cz c` to add a commit
|
||||||
3. Push changes
|
3. Push changes
|
||||||
4. Open pull/merge request
|
4. Open pull/merge request
|
||||||
|
|
||||||
|
## Maintainance
|
||||||
|
|
||||||
|
**Versioning:**
|
||||||
|
TODO; explain versioning
|
||||||
|
|
||||||
|
**Check for unused dependencies:**
|
||||||
|
```sh
|
||||||
|
cargo +nightly udeps --all-targets
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ use sqlx::PgPool;
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
/// Entry point for the application.
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let configuration = get_configuration().expect("Failed to read configuration.");
|
let configuration = get_configuration().expect("Failed to read configuration.");
|
||||||
let addr = format!("127.0.0.1:{}", configuration.application_port);
|
let addr = format!("127.0.0.1:{}", configuration.application_port);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ use sqlx::PgPool;
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
|
|
||||||
/// API routing
|
/// API routing
|
||||||
|
///
|
||||||
|
/// * `connection`: The postgres connection pool
|
||||||
pub fn app(connection: PgPool) -> Router {
|
pub fn app(connection: PgPool) -> Router {
|
||||||
Router::new()
|
Router::new()
|
||||||
.merge(crate::routes::routes_health_check())
|
.merge(crate::routes::routes_health_check())
|
||||||
|
|
@ -12,6 +14,9 @@ pub fn app(connection: PgPool) -> Router {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Start the server
|
/// Start the server
|
||||||
|
///
|
||||||
|
/// * `listener`: The TCP listener
|
||||||
|
/// * `connection`: The postgres connection pool
|
||||||
pub fn run(listener: TcpListener, connection: PgPool) -> Serve<IntoMakeService<Router>, Router> {
|
pub fn run(listener: TcpListener, connection: PgPool) -> Serve<IntoMakeService<Router>, Router> {
|
||||||
axum::serve(listener, app(connection).into_make_service())
|
axum::serve(listener, app(connection).into_make_service())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue