install rust and template

This commit is contained in:
2023-11-19 18:12:00 +00:00
parent 166fef2383
commit d321b7e2de
5 changed files with 158 additions and 13 deletions

12
qstart/src/lib.rs Normal file
View 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")?)
}