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.

28 lines
501 B

2 years ago
package main
import (
2 years ago
"flag"
2 years ago
"fmt"
11 months ago
user "git.diulo.com/mogfee/kit/api"
"git.diulo.com/mogfee/kit/example/service"
"git.diulo.com/mogfee/kit/rest"
"net/http"
2 years ago
)
func main() {
2 years ago
flag.Parse()
11 months ago
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)
}
12 months ago
})
11 months ago
user.RegisterUserHTTPServer(srv, service.NewUserService("abc"))
fmt.Println(srv.Start())
2 years ago
}