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:
13
lib/server/server.go
Normal file
13
lib/server/server.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user