mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
add path for rpc stub (#947)
* add path for rpc stub * fix http body and response_body Co-authored-by: chenzhihui <zhihui_chen@foxmail.com>
This commit is contained in:
@@ -34,8 +34,8 @@ func main() {
|
||||
users: make(map[string]*User),
|
||||
}
|
||||
router := mux.NewRouter()
|
||||
router.Handle("/users", http.NewHandler(us.Add)).Methods("POST")
|
||||
router.Handle("/users/{id}", http.NewHandler(us.Get)).Methods("GET")
|
||||
router.Handle("/users/add", http.NewHandler(us.Add)).Methods("POST")
|
||||
router.Handle("/users/detail", http.NewHandler(us.Get)).Methods("GET")
|
||||
|
||||
httpSrv := http.NewServer(http.Address(":8000"))
|
||||
httpSrv.HandlePrefix("/", router)
|
||||
|
||||
Reference in New Issue
Block a user