This commit is contained in:
@@ -6,6 +6,7 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
actix-service = "2.0.2"
|
||||||
actix-web = "4.4.0"
|
actix-web = "4.4.0"
|
||||||
chrono = { version = "0.4.31", features = ["serde"] }
|
chrono = { version = "0.4.31", features = ["serde"] }
|
||||||
dotenvy = "0.15"
|
dotenvy = "0.15"
|
||||||
@@ -20,4 +21,4 @@ tokio = { version = "1", features = ["fs", "rt-multi-thread"] }
|
|||||||
|
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
pedantic = "warn"
|
pedantic = "warn"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# iot-cloud
|
# iot-cloud
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
- Testing of values, displayName etc.
|
- Env var for fw dir
|
||||||
- Automated testing?
|
- basic auth for uploading
|
||||||
@@ -26,6 +26,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
let external_url = env::var("URL").unwrap_or("localhost".to_string());
|
||||||
info!("Connecting to Database {}", db_url);
|
info!("Connecting to Database {}", db_url);
|
||||||
|
|
||||||
let db = Database::init(&db_url).await;
|
let db = Database::init(&db_url).await;
|
||||||
@@ -36,7 +37,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.app_data(web::Data::new(AppState {
|
.app_data(web::Data::new(AppState {
|
||||||
db: db.clone(),
|
db: db.clone(),
|
||||||
firmwares_path: PathBuf::from("./fw"),
|
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
|
.app_data(web::PayloadConfig::new(256 * 1024 * 1024)) //256MB
|
||||||
.service(device_telemetry_api::receive_telemetry)
|
.service(device_telemetry_api::receive_telemetry)
|
||||||
@@ -52,3 +53,4 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.run()
|
.run()
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user