1
0
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:
longxboy
2021-05-26 14:23:43 +08:00
committed by GitHub
parent 66412031fd
commit eb958b2093
20 changed files with 847 additions and 287 deletions
+2 -2
View File
@@ -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)