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

Method RemoveRoute

router.go:541–549  ·  view source on GitHub ↗

RemoveRoute is used to remove a route from the stack by path. If no methods are specified, it will remove the route for all methods defined in the app. You should call RebuildTree after using this to ensure consistency of the tree.

(path string, methods ...string)

Source from the content-addressed store, hash-verified

539// If no methods are specified, it will remove the route for all methods defined in the app.
540// You should call RebuildTree after using this to ensure consistency of the tree.
541func (app *App) RemoveRoute(path string, methods ...string) {
542 // Normalize same as register uses
543 norm := app.normalizePath(path)
544
545 pathMatchFunc := func(r *Route) bool {
546 return r.path == norm // compare private normalized path
547 }
548 app.deleteRoute(methods, pathMatchFunc)
549}
550
551// RemoveRouteByName is used to remove a route from the stack by name.
552// If no methods are specified, it will remove the route for all methods defined in the app.

Calls 2

normalizePathMethod · 0.95
deleteRouteMethod · 0.95