Refactor server handlers and routing to use a handler struct

This commit is contained in:
2025-07-17 21:46:26 +02:00
parent 1e962438bf
commit 6f571dd91c
4 changed files with 82 additions and 30 deletions

View File

@@ -13,7 +13,16 @@ import (
// @license.url https://opensource.org/license/mit/
// @basePath /api/v1
func main() {
r := llamactl.SetupRouter()
// Initialize the instance manager
instanceManager := llamactl.NewInstanceManager()
// Create a new handler with the instance manager
handler := llamactl.NewHandler(instanceManager)
// Setup the router with the handler
r := llamactl.SetupRouter(handler)
// Start the server with the router
fmt.Println("Starting llamactl on port 8080...")
http.ListenAndServe(":8080", r)