Setup swagger and swagger UI properly

This commit is contained in:
Kristoffer Dalby committed 2021-10-30 14:29:53 +00:00
1 parent 2b340e8fa4
commit 482a31b66b
2 files changed
+67 -2

No files matched your search

+2 -2
View File
@@ -381,8 +381,8 @@ func (h *Headscale) Serve() error {
r.POST("/machine/:id", h.RegistrationHandler)
r.GET("/apple", h.AppleMobileConfig)
r.GET("/apple/:platform", h.ApplePlatformConfig)
r.StaticFile("/swagger/swagger.json", "gen/openapiv2/v1/headscale.swagger.json")
r.GET("/swagger", SwaggerUI)
r.GET("/swagger/v1/openapiv2.json", SwaggerAPIv1)
api := r.Group("/api")
api.Use(h.httpAuthenticationMiddleware)