move breadcrumb controller to right dir

port info on server start
This commit is contained in:
2022-12-09 15:44:27 +01:00
parent 4e7694f653
commit 7c3a80522f
5 changed files with 13 additions and 5 deletions

View File

@ -5,6 +5,7 @@ mod parser;
#[cfg(feature = "static")]
mod embed;
use rocket::error::ErrorKind;
use rocket::serde::json::Json;
#[cfg(feature = "static")]
use crate::embed::CustomHandler;
@ -23,11 +24,18 @@ fn get_disks() -> Json<Vec<Disk>> {
#[rocket::main]
async fn main() -> Result<(), rocket::Error> {
println!("init");
println!("init server");
println!("access at: http://127.0.0.1:8000/");
let b = rocket::build();
let b = b.mount("/api", routes![get_raid_devices, get_disks]);
#[cfg(feature = "static")]
let b = b.mount("/", CustomHandler{});
let _rocket = b.launch().await?;
if let Err(_rocket) = b.launch().await {
match _rocket.kind() {
ErrorKind::Bind(_) => println!("Bind address already in use!"),
e => println!("{}", e.to_string())
}
}
Ok(())
}