This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user