Ejemplo n.º 1
0
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
}
Ejemplo n.º 2
0
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)
}