- 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
14 lines
205 B
Go
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)
|
|
}
|