chore: Add files to create in a leptos project in try_rust example
This commit is contained in:
parent
258cfa279e
commit
4fa2b8deb6
1
examples/try_rust_webapp/files_to_add/.dockerignore
Normal file
1
examples/try_rust_webapp/files_to_add/.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
harmony
|
20
examples/try_rust_webapp/files_to_add/Cargo.toml
Normal file
20
examples/try_rust_webapp/files_to_add/Cargo.toml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[package]
|
||||||
|
name = "harmony-tryrust"
|
||||||
|
edition = "2024"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
harmony = { path = "../../../nationtech/harmony/harmony" }
|
||||||
|
harmony_cli = { path = "../../../nationtech/harmony/harmony_cli" }
|
||||||
|
harmony_types = { path = "../../../nationtech/harmony/harmony_types" }
|
||||||
|
harmony_macros = { path = "../../../nationtech/harmony/harmony_macros" }
|
||||||
|
tokio = { version = "1.40", features = [
|
||||||
|
"io-std",
|
||||||
|
"fs",
|
||||||
|
"macros",
|
||||||
|
"rt-multi-thread",
|
||||||
|
] }
|
||||||
|
log = { version = "0.4", features = ["kv"] }
|
||||||
|
env_logger = "0.11"
|
||||||
|
url = "2.5"
|
||||||
|
base64 = "0.22.1"
|
45
examples/try_rust_webapp/files_to_add/main.rs
Normal file
45
examples/try_rust_webapp/files_to_add/main.rs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
use harmony::{
|
||||||
|
inventory::Inventory,
|
||||||
|
modules::{
|
||||||
|
application::{
|
||||||
|
ApplicationScore, RustWebFramework, RustWebapp,
|
||||||
|
features::{ContinuousDelivery, Monitoring, rhob_monitoring::RHOBMonitoring},
|
||||||
|
},
|
||||||
|
monitoring::alert_channel::discord_alert_channel::DiscordWebhook,
|
||||||
|
},
|
||||||
|
topology::K8sAnywhereTopology,
|
||||||
|
};
|
||||||
|
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 app = ApplicationScore {
|
||||||
|
features: vec![
|
||||||
|
Box::new(ContinuousDelivery {
|
||||||
|
application: application.clone(),
|
||||||
|
}),
|
||||||
|
Box::new(RHOBMonitoring {
|
||||||
|
application: application.clone(),
|
||||||
|
alert_receiver: vec![],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
application,
|
||||||
|
};
|
||||||
|
|
||||||
|
harmony_cli::run(
|
||||||
|
Inventory::autoload(),
|
||||||
|
K8sAnywhereTopology::from_env(),
|
||||||
|
vec![Box::new(app)],
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user