package main import ( "github.com/gofiber/fiber/v2" "github.com/jmoiron/sqlx" ) func initRouter(app *fiber.App, db *sqlx.DB) { app.Static("/", "app/dist") app.Static("/assets", "app/dist/assets", fiber.Static{ Compress: true, }) app.Static("/fonts", "app/dist/fonts", fiber.Static{ Compress: true, }) app.Get("/albums", albums(db)) } func albums(db *sqlx.DB) fiber.Handler { return func(c *fiber.Ctx) error { albums := getAlbums(db) // fmt.Printf("- получено albums: (%d)\n", len(albums)) return c.JSON(albums) } }