Removed DLL

Added All functions from DLL into HarmonyLinkServer
This commit is contained in:
Jordon Brooks 2023-06-22 01:40:59 +01:00
parent 53773040d6
commit 0d5497be1c
27 changed files with 2146 additions and 64 deletions

26
src/api/server.rs Normal file
View file

@ -0,0 +1,26 @@
use actix_web::HttpServer;
use crate::api::endpoints::*;
pub async fn start_actix_web(port: u16) -> std::io::Result<()> {
//std::env::set_var("RUST_LOG", "debug");
//std::env::set_var("RUST_BACKTRACE", "1");
println!("Starting webserver on 127.0.0.1:{}", port);
HttpServer::new(move || {
let logger = actix_web::middleware::Logger::default();
actix_web::App::new()
.wrap(logger)
.service(index)
.service(get_all_info)
.service(get_os_info)
.service(get_battery_info)
.service(get_version_info)
.service(get_dock_info)
})
.bind(("127.0.0.1", port))?
.run()
.await
}