14 lines
432 B
Rust
14 lines
432 B
Rust
use spin_sdk::http::{IntoResponse, Request, Response};
|
|
use spin_sdk::http_component;
|
|
|
|
/// A simple Spin HTTP component.
|
|
#[http_component]
|
|
fn handle_spin_test_app(req: Request) -> anyhow::Result<impl IntoResponse> {
|
|
println!("Handling request to {:?}", req.header("spin-full-url"));
|
|
Ok(Response::builder()
|
|
.status(200)
|
|
.header("content-type", "text/plain")
|
|
.body("Hello, Fermyon")
|
|
.build())
|
|
}
|