Files
WarpBox/lib/server/server.go
Daniel Legt 6e29f644ba feat(cli): add cobra-based CLI to run WarpBox server
- Add `cmd/main.go` with a new `warpbox` root command and `run` subcommand
- Support `--addr` flag (default `:8080`) and delegate startup to `server.Run`
- Initialize Go module and dependencies (cobra, gin) via `go.mod`/`go.sum` to enable building the new CLI entrypointfeat(cli): add cobra-based CLI to run WarpBox server

- Add `cmd/main.go` with a new `warpbox` root command and `run` subcommand
- Support `--addr` flag (default `:8080`) and delegate startup to `server.Run`
- Initialize Go module and dependencies (cobra, gin) via `go.mod`/`go.sum` to enable building the new CLI entrypoint
2026-04-25 17:40:39 +03:00

14 lines
205 B
Go

package server
import "github.com/gin-gonic/gin"
func Run(addr string) error {
router := gin.Default()
router.GET("/", func(ctx *gin.Context) {
ctx.String(200, "ok")
})
return router.Run(addr)
}