Create Pagination
how can create pagination for JSON response in controller return like:
perPage
current page
nextPage
total page
and others...
something like Laravel (php) pagination or Rails or other frameworks
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
you can create a middleware to treat it or a method too
e.g
func Pagination(data interface{}, pageActual, limitItems int) (result []interface{}, err error) {
// your logic
}
app.Get("/", func(c *fiber.Ctx) {
result := Pagination(...)
c.JSON(fiber.Map{
"data": result,
"nextPage: ...
....
})
}