diff --git a/__shuttle/README.md b/__shuttle/README.md index f0f3d93..18444cc 100644 --- a/__shuttle/README.md +++ b/__shuttle/README.md @@ -3,7 +3,15 @@ cargo install cargo-shuttle ``` +Init +``` +cargo shuttle init --axum --name +``` +Deploy +``` +cargo shuttle deploy +``` Reference: diff --git a/__shuttle/hatter-test/Cargo.toml b/__shuttle/hatter-test/Cargo.toml new file mode 100644 index 0000000..66c3f40 --- /dev/null +++ b/__shuttle/hatter-test/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "hatter-test" +version = "0.1.0" +edition = "2021" + +[lib] + +[dependencies] +shuttle-service = { version = "0.5.2", features = ["web-axum"] } +axum = "0.5.16" +sync_wrapper = "0.1.1" diff --git a/__shuttle/hatter-test/src/lib.rs b/__shuttle/hatter-test/src/lib.rs new file mode 100644 index 0000000..b6b2d6d --- /dev/null +++ b/__shuttle/hatter-test/src/lib.rs @@ -0,0 +1,14 @@ +use axum::{routing::get, Router}; +use sync_wrapper::SyncWrapper; + +async fn hello_world() -> &'static str { + "Hello, world!" +} + +#[shuttle_service::main] +async fn axum() -> shuttle_service::ShuttleAxum { + let router = Router::new().route("/hello", get(hello_world)); + let sync_wrapper = SyncWrapper::new(router); + + Ok(sync_wrapper) +} \ No newline at end of file