init rust stuff

This commit is contained in:
2025-10-27 18:11:45 -07:00
parent b0f767da7d
commit de9db3695c
9 changed files with 950 additions and 0 deletions

20
src/lib.rs Normal file
View File

@@ -0,0 +1,20 @@
use axum::{routing::get, Router};
use tower_service::Service;
use worker::*;
fn router() -> Router {
Router::new().route("/", get(root))
}
#[event(fetch)]
async fn fetch(
req: HttpRequest,
_env: Env,
_ctx: Context,
) -> Result<axum::http::Response<axum::body::Body>> {
Ok(router().call(req).await?)
}
pub async fn root() -> &'static str {
"Hello Axum!"
}