Usage
Use the resource by annotating your main function with theshuttle_runtime::ShuttleMetadata attribute.
Example
main.rs
DeploymentMetadata struct:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
shuttle_runtime::ShuttleMetadata attribute.
use axum::{routing::get, Router};
use shuttle_runtime::DeploymentMetadata;
#[shuttle_runtime::main]
async fn axum(
#[shuttle_runtime::Metadata] metadata: DeploymentMetadata,
) -> shuttle_axum::ShuttleAxum {
let router = Router::new().route("/", get(format!("{:?}", metadata)));
Ok(router.into())
}
DeploymentMetadata struct:
DeploymentMetadata { env: Local, project_name: "metadata-axum-app", storage_path: ".shuttle-storage" }
Was this page helpful?
