use gotcha::prelude::*;
#[tokio::test]
async fn test_builder_api_compiles() {
let _gotcha = Gotcha::new()
.get("/", || async { "Hello World" })
.get("/hello/:name", |Path(name): Path<String>| async move { format!("Hello, {}!", name) })
.post("/echo", |body: String| async move { format!("Echo: {}", body) })
.routes(|router| router.get("/nested/ping", || async { "pong" }));
}
#[tokio::test]
async fn test_fluent_interface() {
let _gotcha = Gotcha::new()
.host("0.0.0.0")
.port(8080)
.get("/", || async { "root" })
.post("/create", || async { "created" })
.put("/update", || async { "updated" })
.delete("/delete", || async { "deleted" })
.patch("/patch", || async { "patched" });
}
#[tokio::test]
async fn test_configuration() {
let _gotcha = Gotcha::new().host("0.0.0.0").port(8080);
}