package main import ( "flag" "fmt" user "git.diulo.com/mogfee/kit/api" "git.diulo.com/mogfee/kit/example/service" "git.diulo.com/mogfee/kit/rest" "net/http" ) func main() { flag.Parse() srv := rest.NewServer(rest.RestConf{ Host: "localhost", Port: 8998, }) srv.Use(func(next http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { next(w, r) } }) user.RegisterUserHTTPServer(srv, service.NewUserService("abc")) fmt.Println(srv.Start()) }