You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
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())
|
|
|
|
}
|