skeleton handlers
This commit is contained in:
commit
d9e1fa5e88
|
@ -0,0 +1 @@
|
|||
/target
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue