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
- // This route path will match requests to the root route, "/":
- app.Get("/", func(c *fiber.Ctx) {
- c.Send("root")
- })
- // This route path will match requests to "/about":
- app.Get("/about", func(c *fiber.Ctx) {
- c.Send("about")
- })
- // This route path will match requests to "/random.txt":
- app.Get("/random.txt", func(c *fiber.Ctx) {
- c.Send("random.txt")
- })