MCPcopy
hub / github.com/gofiber/fiber / Route

Method Route

domain.go:592–605  ·  view source on GitHub ↗

Route defines routes with a common prefix inside the supplied function, scoped to the domain pattern.

(prefix string, fn func(router Router), name ...string)

Source from the content-addressed store, hash-verified

590// Route defines routes with a common prefix inside the supplied function,
591// scoped to the domain pattern.
592func (d *domainRouter) Route(prefix string, fn func(router Router), name ...string) Router {
593 if fn == nil {
594 panic("route handler 'fn' cannot be nil")
595 }
596
597 group := d.Group(prefix)
598 if len(name) > 0 {
599 group.Name(name[0])
600 }
601
602 fn(group)
603
604 return group
605}
606
607// Name assigns a name to the most recently registered route.
608// When the domain router was created from a Group, this delegates to the

Callers

nothing calls this directly

Calls 2

GroupMethod · 0.95
NameMethod · 0.65

Tested by

no test coverage detected