skeleton handlers

This commit is contained in:
blek 2023-10-10 00:40:00 +10:00
commit d9e1fa5e88
Signed by: blek
GPG Key ID: 14546221E3595D0C
4 changed files with 1121 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1088
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

14
Cargo.toml Normal file
View File

@ -0,0 +1,14 @@
[package]
name = "miniqr"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.33.0", features = ["full"] }
warp = "0.3.6"
[profile.release]
opt-level = 'z'
lto = true

18
src/main.rs Normal file
View File

@ -0,0 +1,18 @@
use warp::Filter;
#[tokio::main]
async fn main() {
// Match any request and return hello world!
let routes =
warp::path::end()
.map(|| "Hello, World!")
.or(
warp::path!(String)
.and(
warp::get()
)
.map(|x| format!("u get {x}"))
);
warp::serve(routes).run(([127, 0, 0, 1], 3030)).await;
}