18 lines
438 B
Go
18 lines
438 B
Go
package httpserver
|
|
|
|
import (
|
|
"Rezina-Backend/internal/apidocs"
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
// audienceSpecification exposes only an audience's routes and referenced schemas.
|
|
func audienceSpecification(audience string) fiber.Handler {
|
|
return func(c *fiber.Ctx) error {
|
|
spec, err := apidocs.Specification(audience)
|
|
if err != nil {
|
|
return fiber.NewError(500, "Unable to load API documentation")
|
|
}
|
|
return c.JSON(spec)
|
|
}
|
|
}
|