Add swagger docs

This commit is contained in:
2025-07-17 21:26:49 +02:00
parent 828ad0ec64
commit 1e962438bf
7 changed files with 347 additions and 2 deletions

View File

@@ -3,12 +3,19 @@ package llamactl
import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
httpSwagger "github.com/swaggo/http-swagger"
_ "llamactl/docs"
)
func SetupRouter() *chi.Mux {
r := chi.NewRouter()
r.Use(middleware.Logger)
r.Get("/swagger/*", httpSwagger.Handler(
httpSwagger.URL("/swagger/doc.json"), // The URL pointing to API definition
))
// Define routes
r.Route("/api/v1", func(r chi.Router) {
r.Get("/server/help", HelpHandler)