Setup routing

This commit is contained in:
2025-07-17 21:20:14 +02:00
parent 5156d4a062
commit 5d6a38a7eb
3 changed files with 73 additions and 59 deletions

24
server/pkg/routes.go Normal file
View File

@@ -0,0 +1,24 @@
package llamactl
import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)
func SetupRouter() *chi.Mux {
r := chi.NewRouter()
r.Use(middleware.Logger)
// Define routes
r.Route("/api/v1", func(r chi.Router) {
r.Get("/server/help", HelpHandler)
r.Get("/server/version", VersionHandler)
r.Get("/server/devices", ListDevicesHandler)
// Launch and stop handlers
// r.Post("/server/launch/{model}", launchHandler)
// r.Post("/server/stop/{model}", stopHandler)
})
return r
}