Switched over to migrations
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user