From dbf88195b92ad0605475c5a6b81bb11a8320e4a7 Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Wed, 3 Oct 2018 17:59:07 +0200 Subject: [PATCH] added api version --- backend/api.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/api.go b/backend/api.go index 2722359..8802296 100644 --- a/backend/api.go +++ b/backend/api.go @@ -21,16 +21,16 @@ import ( // Endpoints: // // Config -// Show /api/config +// Show /api/v1/config // // Routeservers -// List /api/routeservers -// Status /api/routeservers/:id/status -// Neighbors /api/routeservers/:id/neighbours -// Routes /api/routeservers/:id/neighbours/:neighbourId/routes +// List /api/v1/routeservers +// Status /api/v1/routeservers/:id/status +// Neighbors /api/v1/routeservers/:id/neighbours +// Routes /api/v1/routeservers/:id/neighbours/:neighbourId/routes // // Querying -// LookupPrefix /api/routeservers/:id/lookup/prefix?q= +// LookupPrefix /api/v1/routeservers/:id/lookup/prefix?q= // type apiEndpoint func(*http.Request, httprouter.Params) (api.Response, error) @@ -88,28 +88,28 @@ func endpoint(wrapped apiEndpoint) httprouter.Handle { func apiRegisterEndpoints(router *httprouter.Router) error { // Meta - router.GET("/api/status", endpoint(apiStatusShow)) - router.GET("/api/config", endpoint(apiConfigShow)) + router.GET("/api/v1/status", endpoint(apiStatusShow)) + router.GET("/api/v1/config", endpoint(apiConfigShow)) // Routeservers - router.GET("/api/routeservers", + router.GET("/api/v1/routeservers", endpoint(apiRouteserversList)) - router.GET("/api/routeservers/:id/status", + router.GET("/api/v1/routeservers/:id/status", endpoint(apiStatus)) - router.GET("/api/routeservers/:id/neighbours", + router.GET("/api/v1/routeservers/:id/neighbours", endpoint(apiNeighborsList)) - router.GET("/api/routeservers/:id/neighbours/:neighbourId/routes", + router.GET("/api/v1/routeservers/:id/neighbours/:neighbourId/routes", endpoint(apiRoutesList)) - router.GET("/api/routeservers/:id/neighbours/:neighbourId/routes/received", + router.GET("/api/v1/routeservers/:id/neighbours/:neighbourId/routes/received", endpoint(apiRoutesListReceived)) - router.GET("/api/routeservers/:id/neighbours/:neighbourId/routes/filtered", + router.GET("/api/v1/routeservers/:id/neighbours/:neighbourId/routes/filtered", endpoint(apiRoutesListFiltered)) - router.GET("/api/routeservers/:id/neighbours/:neighbourId/routes/not-exported", + router.GET("/api/v1/routeservers/:id/neighbours/:neighbourId/routes/not-exported", endpoint(apiRoutesListNotExported)) // Querying if AliceConfig.Server.EnablePrefixLookup == true { - router.GET("/api/lookup/prefix", + router.GET("/api/v1/lookup/prefix", endpoint(apiLookupPrefixGlobal)) }