mirror of https://github.com/gofiber/fiber.git
Update README_zh-CN.md
parent
6e74dfe71a
commit
e310d12c79
|
@ -159,6 +159,18 @@ func main() {
|
||||||
// => Name: john, Age:
|
// => Name: john, Age:
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// GET /plantae/prunus.persica
|
||||||
|
app.Get("/plantae/:genus.:species", func(c *fiber.Ctx) {
|
||||||
|
fmt.Printf("Genius: %s, Species: %s", c.Params("genus"), c.Params("species"))
|
||||||
|
// => Genius: prunus, Species: persica
|
||||||
|
})
|
||||||
|
|
||||||
|
// GET /flights/LAX-SFO
|
||||||
|
app.Get("/flights/:from-:to", func(c *fiber.Ctx) {
|
||||||
|
fmt.Printf("From: %s, To: %s", c.Params("from"), c.Params("to"))
|
||||||
|
// => From: LAX, To: SFO
|
||||||
|
})
|
||||||
|
|
||||||
// GET /api/register
|
// GET /api/register
|
||||||
app.Get("/api/*", func(c *fiber.Ctx) {
|
app.Get("/api/*", func(c *fiber.Ctx) {
|
||||||
fmt.Printf("/api/%s", c.Params("*"))
|
fmt.Printf("/api/%s", c.Params("*"))
|
||||||
|
|
Loading…
Reference in New Issue