install rust and template
This commit is contained in:
12
qstart/src/lib.rs
Normal file
12
qstart/src/lib.rs
Normal file
@ -0,0 +1,12 @@
|
||||
use spin_sdk::http::{IntoResponse, Request};
|
||||
use spin_sdk::http_component;
|
||||
|
||||
/// A simple Spin HTTP component.
|
||||
#[http_component]
|
||||
fn handle_qstart(req: Request) -> anyhow::Result<impl IntoResponse> {
|
||||
println!("Handling request to {:?}", req.header("spin-full-url"));
|
||||
Ok(http::Response::builder()
|
||||
.status(200)
|
||||
.header("content-type", "text/plain")
|
||||
.body("Hello, Fermyon")?)
|
||||
}
|
Reference in New Issue
Block a user