Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HotReloadServe = &gcli.Command{ Name: "hotreload", Aliases: []string{"hot:reload"}, UseFor: "hot reload serve on files modified", Config: func(c *gcli.Command) { }, Func: func(c *gcli.Command, _ []string) error { return errors.New("TODO") }, }
View Source
var HttpServe = &gcli.Command{ Name: "serve", UseFor: "start an http application serve", Aliases: []string{"server", "http:serve"}, Config: func(c *gcli.Command) { c.StrOpt(&httpServeOpts.env, "env", "", app.EnvDev, "the application env name") c.BoolOpt(&httpServeOpts.debug, "debug", "", true, "the debug mode for run serve") c.StrOpt(&httpServeOpts.runtime, "runtime", "", "", "the runtime directory path") c.StrVar(&httpServeOpts.host, gcli.FlagMeta{ Name: "host", Shorts: []string{"h"}, Desc: "host for the start http serve", DefVal: "127.0.0.1", }) c.IntVar(&httpServeOpts.port, gcli.FlagMeta{ Name: "port", Shorts: []string{"p"}, Desc: "port for the start http serve", DefVal: 8080, }) }, Func: func(c *gcli.Command, args []string) error { dump.P(httpServeOpts) return nil s := httpserve.New() r := s.Rux() r.Use(handlers.PanicsHandler()) if httpServeOpts.debug { r.Use(handlers.RequestLogger()) } web.AddRoutes(r) r.Listen("127.0.0.1:18080") return nil }, }
HttpServe Command
Functions ¶
func AddCommands ¶
func AddCommands(app *gcli.App)
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.