Skip to content

Commit

Permalink
chore: Remove local dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
morlinbrot committed May 25, 2023
1 parent 6459ea1 commit 66b10b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions axum/with-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
axum = "0.6.10"
shuttle-axum = { version = "0.16.0", path = "../../../services/shuttle-axum" }
shuttle-runtime = { version = "0.16.0", path = "../../../runtime" }
shuttle-axum = { version = "0.16.0" }
shuttle-runtime = { version = "0.16.0" }
tokio = { version = "1.26.0" }
6 changes: 3 additions & 3 deletions axum/with-state/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ use std::sync::Arc;
use axum::{extract::State, response::IntoResponse, routing::get, Router};

async fn hello_world(State(state): State<Arc<AppState>>) -> impl IntoResponse {
state.name
state.msg
}

#[derive(Clone)]
struct AppState {
name: &'static str,
msg: &'static str,
}

#[shuttle_runtime::main]
async fn axum() -> shuttle_axum::ShuttleAxum {
let state = Arc::new(AppState {
name: "Hello, world!",
msg: "Hello, world!",
});

let router = Router::new().route("/", get(hello_world)).with_state(state);
Expand Down

0 comments on commit 66b10b8

Please sign in to comment.