package main import ( "flag" "fmt" "git.diulo.com/mogfee/kit" user "git.diulo.com/mogfee/kit/api" "git.diulo.com/mogfee/kit/example/service" "git.diulo.com/mogfee/kit/middleware/jwt" "git.diulo.com/mogfee/kit/transport/http" ) func main() { flag.Parse() runApp("localhost:8080") } func runApp(host string) { hs := http.NewServer( http.Address(host), http.Middleware(jwt.JWT(jwt.WithJwtKey("Jt6Zv!KTopXZ6S4C"))), ) user.RegisterUserHTTPServer(hs, service.NewUserService("1234567890123456")) app := kit.New(kit.Server(hs)) fmt.Println(app.Run()) fmt.Println(app.Stop()) }