feat: add web frontend to control the API

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-21 19:00:19 +01:00
parent 666ce4308f
commit c48ef1cf3f
5 changed files with 279 additions and 0 deletions

View file

@ -1,4 +1,5 @@
use actix_files as fs;
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
use chrono::{Local, Timelike};
use get_if_addrs::get_if_addrs;
@ -158,6 +159,8 @@ pub async fn start_api_server(
.service(manual_sync)
.service(get_config)
.service(update_config)
// Serve frontend static files
.service(fs::Files::new("/", "static/").index_file("index.html"))
})
.bind("0.0.0.0:8080")?
.run()