func (s *layerServer) createRouter() server.Router { registry := api.NewRemoteRegistry() router := server.Router{mux.NewRouter()} registry.Routes("/registry", &router) // Handler for ExpVar request router.Path("/debug/vars").Methods("GET").HandlerFunc(expvarHandler) return router }
func (reg *registryApi) Routes(context string, router *server.Router) { routes := server.RouteMap{ "GET": { "/status": reg.handleStatus, "/search": reg.handleSearch, "/images/{front}/tags": reg.handleTags, "/images/{front}/{tail}/tags": reg.handleTags, }, "POST": { "/analyze": reg.handleAnalysis, }, } router.AddCorsRoutes(context, routes) }