API server build with Hertz and ent.
- Easy to build framework HTTP RESP API server with hz
- ORM modeling with ent.
- Auto-reload for development with air
- Define API with Protobuf
# init project
make init
# add ent. model: User
make model name=User
# add sample idl:hello for rest api
make update idl=idl/hello/hello.proto
modify biz/handler/demo/hello_service.go
resp := new(demo.HelloResp)
+ resp.RespBody = "Hello, " + req.Name
c.JSON(consts.StatusOK, resp)
go mod tidy
make dev
# expect: {"message":"pong"}
curl http://localhost:8888/ping
# expect: {"RespBody":"Hello, Andy"}
curl http://localhost:8888/hello?name=Andy