From dbdfdc5fbe660845eb3f8bd195bf75f29aae54d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vic=20Sh=C3=B3stak?= Date: Fri, 19 Jun 2020 13:12:05 +0300 Subject: [PATCH] Add new Routing feature to README --- .github/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/README.md b/.github/README.md index 9d47eb4e..95a33906 100644 --- a/.github/README.md +++ b/.github/README.md @@ -159,7 +159,19 @@ func main() { fmt.Printf("Name: %s, Age: %s", c.Params("name"), c.Params("age")) // => Name: john, Age: }) + + // GET /plantae/prunus.persica + app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) { + c.Params("genus") // => prunus + c.Params("species") // => persica + }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + c.Params("from") // => LAX + c.Params("to") // => SFO + }) + // GET /api/register app.Get("/api/*", func(c *fiber.Ctx) { fmt.Printf("/api/%s", c.Params("*"))