Switched over to migrations

This commit is contained in:
2023-09-16 19:08:20 +00:00
parent f4ed0f9af2
commit 3f9dcb3a53
5 changed files with 54 additions and 54 deletions

View File

@@ -1,4 +1,4 @@
use actix_web::{post, web, App, HttpServer, Responder};
use actix_web::{post, web, App, HttpServer, Responder, http::StatusCode, HttpResponse};
use database::Database;
use log::info;
@@ -13,7 +13,9 @@ async fn receive_telemetry(
device_id: web::Path<String>,
data: web::Data<AppState>,
) -> impl Responder {
format!("Hello {}!", &device_id)
data.db.create_device_if_not_exists(&device_id);
HttpResponse::Ok()
}
#[actix_web::main]