rename ngin to rest

This commit is contained in:
kevin
2020-07-31 11:14:48 +08:00
parent e133ffd820
commit 0897f60c5d
78 changed files with 118 additions and 111 deletions

View File

@@ -7,8 +7,8 @@ import (
"zero/core/logx"
"zero/core/service"
"zero/ngin"
"zero/ngin/httpx"
"zero/rest"
"zero/rest/httpx"
)
var (
@@ -37,7 +37,7 @@ func handlePost(w http.ResponseWriter, r *http.Request) {
func main() {
flag.Parse()
engine := ngin.MustNewEngine(ngin.NgConf{
engine := rest.MustNewEngine(rest.RtConf{
ServiceConf: service.ServiceConf{
Log: logx.LogConf{
Mode: "console",
@@ -51,12 +51,12 @@ func main() {
})
defer engine.Stop()
engine.AddRoute(ngin.Route{
engine.AddRoute(rest.Route{
Method: http.MethodGet,
Path: "/",
Handler: handleGet,
})
engine.AddRoute(ngin.Route{
engine.AddRoute(rest.Route{
Method: http.MethodPost,
Path: "/",
Handler: handlePost,