Start to implement energy consumption backend

This commit is contained in:
2024-06-29 10:11:31 +02:00
parent 9d3e2beb81
commit 49a3e3a669
8 changed files with 66 additions and 2 deletions

View File

@ -6,6 +6,7 @@ use crate::app_config::AppConfig;
use crate::crypto::pki;
pub mod custom_error;
pub mod energy_controller;
pub mod pki_controller;
pub mod server_controller;
@ -48,6 +49,10 @@ pub async fn secure_server() -> anyhow::Result<()> {
App::new()
.wrap(Logger::default())
.route("/", web::get().to(server_controller::secure_home))
.route(
"/api/energy/curr_consumption",
web::get().to(energy_controller::curr_consumption),
)
})
.bind_openssl(&AppConfig::get().listen_address, builder)?
.run()