feat: add hatter-test
This commit is contained in:
@@ -3,7 +3,15 @@
|
|||||||
cargo install cargo-shuttle
|
cargo install cargo-shuttle
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Init
|
||||||
|
```
|
||||||
|
cargo shuttle init --axum --name <name> <name>
|
||||||
|
```
|
||||||
|
|
||||||
|
Deploy
|
||||||
|
```
|
||||||
|
cargo shuttle deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Reference:
|
Reference:
|
||||||
|
|||||||
11
__shuttle/hatter-test/Cargo.toml
Normal file
11
__shuttle/hatter-test/Cargo.toml
Normal file
@@ -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"
|
||||||
14
__shuttle/hatter-test/src/lib.rs
Normal file
14
__shuttle/hatter-test/src/lib.rs
Normal file
@@ -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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user