added init

This commit is contained in:
2023-09-15 18:58:52 +00:00
parent 3b2f636e41
commit f4ed0f9af2
3 changed files with 61 additions and 14 deletions

View File

@@ -9,8 +9,10 @@ struct AppState {
}
#[post("/telemetry/{device_id}")]
async fn receive_telemetry(device_id: web::Path<String>, data: web::Data<AppState>) -> impl Responder {
data.db.add_telementry();
async fn receive_telemetry(
device_id: web::Path<String>,
data: web::Data<AppState>,
) -> impl Responder {
format!("Hello {}!", &device_id)
}