diff --git a/frameworks/Rust/axum/Makefile b/frameworks/Rust/axum/Makefile index fc6ba34..fbff9a7 100644 --- a/frameworks/Rust/axum/Makefile +++ b/frameworks/Rust/axum/Makefile @@ -1,4 +1,6 @@ -CARGO = cargo +RUSTFLAGS := "-Z threads=8 -C target-cpu=native" + +CARGO = RUSTFLAGS=$(RUSTFLAGS) cargo RUSTC = rustc CROSS = cross @@ -7,7 +9,7 @@ all: build build: $(CARGO) build -release: clean +release: $(CARGO) build --release dev: @@ -53,10 +55,4 @@ freebsd: clean-release loongarch: clean-release $(CROSS) build --release --target loongarch64-unknown-linux-gnu -deps: - python -m venv venus \ - && source venus/bin/activate \ - && pip install -r scripts/requirements.txt \ - && python scripts/download-core.py - .PHONY: all diff --git a/frameworks/Rust/axum/src/routes/mod.rs b/frameworks/Rust/axum/src/routes/mod.rs index cef695c..e45e4bf 100644 --- a/frameworks/Rust/axum/src/routes/mod.rs +++ b/frameworks/Rust/axum/src/routes/mod.rs @@ -20,6 +20,7 @@ use crate::{ }; pub mod json; +pub mod text; #[derive(Debug, Serialize)] pub struct RouteResponse @@ -57,6 +58,7 @@ pub fn routes() -> Router { let router = Router::new() .route("/", get(hello).post(hello)) .route("/json", get(json::json).post(json::json)) + .route("/text", get(text::text).post(text::text)) .layer( ServiceBuilder::new() .layer(middleware::from_fn(add_version)) diff --git a/frameworks/Rust/axum/src/routes/text.rs b/frameworks/Rust/axum/src/routes/text.rs new file mode 100644 index 0000000..8abda0f --- /dev/null +++ b/frameworks/Rust/axum/src/routes/text.rs @@ -0,0 +1,5 @@ +use axum::response::IntoResponse; + +pub async fn text() -> impl IntoResponse { + "xfy" +}