parcoursmob/servers/web/protected_api_routes.go

12 lines
388 B
Go

package web
import (
"github.com/gorilla/mux"
)
func (ws *WebServer) setupProtectedAPIRoutes(r *mux.Router) {
api_router := r.PathPrefix("/api").Subrouter()
protected_api_router := api_router.PathPrefix("/protected").Subrouter()
protected_api_router.Use(ws.protectedAPIHandler.ApiKeyMiddleware)
protected_api_router.HandleFunc("/users", ws.protectedAPIHandler.UsersHTTPHandler())
}