kjuulh 7c11555a53
feat: with spin test app
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-01-23 21:24:01 +01:00

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())
}