diff options
| author | batsumaru <> | 2026-10-16 14:29:08 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-10-16 14:29:08 +0900 |
| commit | 784e52da5f3bef26655c77b210b3b105847e3d9a (patch) | |
| tree | db49dd742a0f4e6ff72e33e8255b16b487da851a /src/main.rs | |
| parent | a69e78b7482227f22e7ddbfaa7dc7ee31f29a99b (diff) | |
Add delete and update
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index acf8896..04f4c99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,7 @@ mod models; use axum::{ Router, - routing::{get, post}, + routing::{delete, get, post, put}, }; use dotenvy::dotenv; @@ -19,6 +19,11 @@ async fn main() -> anyhow::Result<()> { .route("/all", get(handlers::all)) .route("/add", post(handlers::add)) .route("/search", get(handlers::search)) + .route("/units", get(handlers::units)) + .route("/metric_types", get(handlers::metric_types)) + .route("/measurement/{id}", get(handlers::measurement_by_id)) + .route("/delete/{id}", delete(handlers::delete)) + .route("/update/{id}", put(handlers::update)) .with_state(pool); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?; tracing::info!("listening at 0.0.0.0:3000"); |
