feat: init sproutclaw-web — Go+Gin backend + React frontend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
18
backend/internal/handlers/commands.go
Normal file
18
backend/internal/handlers/commands.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"sproutclaw-web/internal/config"
|
||||
"sproutclaw-web/internal/models"
|
||||
"sproutclaw-web/internal/services"
|
||||
)
|
||||
|
||||
// RegisterCommands registers the slash commands list route.
|
||||
func RegisterCommands(r *gin.RouterGroup, cfg *config.Config) {
|
||||
r.GET("/commands", func(c *gin.Context) {
|
||||
cmds := services.ListSlashCommands(cfg.AgentDir)
|
||||
c.JSON(http.StatusOK, models.CommandsResponse{Commands: cmds})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user