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
This commit is contained in:
2026-04-25 17:40:39 +03:00
parent b54e96adb0
commit 6e29f644ba
4 changed files with 188 additions and 0 deletions

13
lib/server/server.go Normal file
View File

@@ -0,0 +1,13 @@
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)
}