MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / NewRouter

Function NewRouter

rest/routing.go:363–369  ·  view source on GitHub ↗

NewRouter returns a basic router for the given server type.

(sc *ServerContext, serverType serverType)

Source from the content-addressed store, hash-verified

361
362// NewRouter returns a basic router for the given server type.
363func NewRouter(sc *ServerContext, serverType serverType) *mux.Router {
364 r := mux.NewRouter()
365 r.StrictSlash(true)
366 r.Use(withServerType(serverType))
367 addSharedRouterHandlers(sc, r)
368 return r
369}
370
371// addSharedRouterHandlers adds the handlers that are defined on all server types.
372func addSharedRouterHandlers(sc *ServerContext, r *mux.Router) {

Callers 3

createCommonRouterFunction · 0.85
CreateMetricRouterFunction · 0.85
createDiagnosticRouterFunction · 0.85

Calls 2

withServerTypeFunction · 0.85
addSharedRouterHandlersFunction · 0.85

Tested by

no test coverage detected