cmd

package
v0.0.0-...-0e46e86 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Main is the entry for front application.
	Main = gcmd.Command{
		Name:  "main",
		Usage: "main",
		Brief: "start HTTP server",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
			s := g.Server()
			s.SetRewrite("/favicon.ico", "/resource/image/favicon.ico")
			s.Group("/", func(group *ghttp.RouterGroup) {
				group.Middleware(ghttp.MiddlewareCORS, service.Middleware().Initializer, service.Middleware().ClientIP, service.Middleware().RequestLog, service.Middleware().Logger, service.Middleware().HandlerResponse)

				group.ALL("/", comment.NewV1().Compatible)
				group.GET("/count", comment.NewV1().CompatibleCount)
				group.Group("/api.v1/front", func(group *ghttp.RouterGroup) {
					group.Bind(
						authorize.NewV1(),
					)
					group.Bind(
						comment.NewV1(),
					)
				})

			})
			s.Run()
			return nil
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL