mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 09:04:27 +00:00
Setup routing
This commit is contained in:
24
server/pkg/routes.go
Normal file
24
server/pkg/routes.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user