mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 09:04:27 +00:00
Refactor server handlers and routing to use a handler struct
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user