move breadcrumb controller to right dir
port info on server start
This commit is contained in:
@ -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(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user