Files
harmony/examples/try_rust_webapp/files_to_add/main.rs
Jean-Gabriel Gill-Couture 3b2da4d6ff
Some checks failed
Run Check Script / check (pull_request) Failing after 2s
chore: clear compile warnings; retire SecretManager
- Migrate callers from SecretManager to harmony_config::get_or_prompt
- Lazy-init global ConfigClient from HARMONY_SECRET_NAMESPACE
- Convert remaining Secret derives to Config + #[config(secret)]
- Remove deprecated SecretManager
- Retry::spawn → start; drop unused import; cfg-gate nm_bond_mode
- allow(deprecated) on legacy ApplicationScore examples
2026-08-07 19:12:10 -04:00

51 lines
1.4 KiB
Rust

#![allow(deprecated)]
use harmony::{
inventory::Inventory,
modules::{
application::{
features::{rhob_monitoring::Monitoring, PackagingDeployment}, ApplicationScore, RustWebFramework, RustWebapp
},
monitoring::alert_channel::discord_alert_channel::DiscordWebhook,
},
topology::{K8sAnywhereTopology, LocalhostTopology},
};
use harmony_macros::hurl;
use std::{path::PathBuf, sync::Arc};
#[tokio::main]
async fn main() {
let application = Arc::new(RustWebapp {
name: "tryrust".to_string(),
project_root: PathBuf::from(".."),
framework: Some(RustWebFramework::Leptos),
service_port: 8080,
});
let discord_webhook = DiscordWebhook {
name: "harmony-demo".to_string(),
url: hurl!("https://discord.com/api/webhooks/1415391405681021050/V6KzV41vQ7yvbn7BchejRu9C8OANxy0i2ESZOz2nvCxG8xAY3-2i3s5MS38k568JKTzH"),
};
let app = ApplicationScore {
features: vec![
Box::new(PackagingDeployment {
application: application.clone(),
}),
Box::new(Monitoring {
application: application.clone(),
alert_receiver: vec![Box::new(discord_webhook)],
}),
],
application,
};
harmony_cli::run(
Inventory::autoload(),
K8sAnywhereTopology::from_env(),
vec![Box::new(app)],
None,
)
.await
.unwrap();
}