Subdomains
Returns a string slice of subdomains in the domain name of the request.
The application property subdomain offset, which defaults to 2
, is used for determining the beginning of the subdomain segments.
func (c *Ctx) Subdomains(offset ...int) []string
// Host: "tobi.ferrets.example.com"
app.Get("/", func(c *fiber.Ctx) error {
c.Subdomains() // ["ferrets", "tobi"]
c.Subdomains(1) // ["tobi"]
// ...
})