mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-02 03:33:05 +00:00
Fix API router
This commit is contained in:
parent
c6eb7be7fb
commit
a4d0efbe8d
1 changed files with 3 additions and 5 deletions
8
app.go
8
app.go
|
@ -445,11 +445,9 @@ func (h *Headscale) createRouter(grpcMux *runtime.ServeMux) *mux.Router {
|
||||||
router.HandleFunc("/bootstrap-dns", h.DERPBootstrapDNSHandler)
|
router.HandleFunc("/bootstrap-dns", h.DERPBootstrapDNSHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
api := router.PathPrefix("/api").Subrouter()
|
apiRouter := router.PathPrefix("/api").Subrouter()
|
||||||
api.Use(h.httpAuthenticationMiddleware)
|
apiRouter.Use(h.httpAuthenticationMiddleware)
|
||||||
{
|
apiRouter.PathPrefix("/v1/").HandlerFunc(grpcMux.ServeHTTP)
|
||||||
api.HandleFunc("/v1/*any", grpcMux.ServeHTTP)
|
|
||||||
}
|
|
||||||
|
|
||||||
router.PathPrefix("/").HandlerFunc(stdoutHandler)
|
router.PathPrefix("/").HandlerFunc(stdoutHandler)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue