Added external URL
All checks were successful
Build Project / test (push) Successful in 5m53s

This commit is contained in:
2025-02-09 16:00:42 +00:00
parent 79d42c2760
commit 4fb7baf954
3 changed files with 7 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ async fn main() -> std::io::Result<()> {
process::exit(1);
}
};
let external_url = env::var("URL").unwrap_or("localhost".to_string());
info!("Connecting to Database {}", db_url);
let db = Database::init(&db_url).await;
@@ -36,7 +37,7 @@ async fn main() -> std::io::Result<()> {
.app_data(web::Data::new(AppState {
db: db.clone(),
firmwares_path: PathBuf::from("./fw"),
hostname: "0.0.0.0:8282".to_string(),
hostname: external_url.clone(),
}))
.app_data(web::PayloadConfig::new(256 * 1024 * 1024)) //256MB
.service(device_telemetry_api::receive_telemetry)
@@ -52,3 +53,4 @@ async fn main() -> std::io::Result<()> {
.run()
.await
}