Paths

Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns.

Examples of route paths based on strings

  1. // This route path will match requests to the root route, "/":
  2. app.Get("/", func(c *fiber.Ctx) {
  3. c.Send("root")
  4. })
  5.  
  6. // This route path will match requests to "/about":
  7. app.Get("/about", func(c *fiber.Ctx) {
  8. c.Send("about")
  9. })
  10.  
  11. // This route path will match requests to "/random.txt":
  12. app.Get("/random.txt", func(c *fiber.Ctx) {
  13. c.Send("random.txt")
  14. })