Settings working on front-end and with it the notifications list

This commit is contained in:
rzuasti
2026-03-03 12:20:57 -05:00
parent 1d029c8c5f
commit dc2521da65
5 changed files with 181 additions and 24 deletions
+6
View File
@@ -11,6 +11,7 @@ use log::{debug, error, info};
use tower::ServiceBuilder;
use tower_http::cors::{Any, CorsLayer};
use tower_http::services::ServeDir;
use axum::Json;
pub mod devices;
pub mod notifications;
@@ -26,6 +27,7 @@ pub async fn serve() -> Result<(), Box<dyn Error>> {
.allow_headers([http::header::AUTHORIZATION, http::header::CONTENT_TYPE]);
let router = Router::new()
.route("/api/test", get(test_api))
.route("/api/devices", get(devices::list))
.route("/api/devices", put(devices::register))
.route("/api/devices/{mac_address}", delete(devices::unregister))
@@ -60,6 +62,10 @@ pub async fn serve() -> Result<(), Box<dyn Error>> {
Ok(())
}
async fn test_api() -> Result<Json<String>, StatusCode> {
Ok(Json("OOTT_API_OK".to_string()))
}
async fn auth(request: Request, next: Next) -> Result<Response, StatusCode> {
let auth_header = request
.headers()