rename ngin to rest
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package config
|
||||
|
||||
import "zero/ngin"
|
||||
import "zero/rest"
|
||||
|
||||
type Config struct {
|
||||
ngin.NgConf
|
||||
rest.RtConf
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"flag"
|
||||
|
||||
"zero/core/conf"
|
||||
"zero/ngin"
|
||||
"zero/rest"
|
||||
"zero/tools/goctl/api/demo/config"
|
||||
"zero/tools/goctl/api/demo/handler"
|
||||
)
|
||||
@@ -17,7 +17,7 @@ func main() {
|
||||
var c config.Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
|
||||
engine := ngin.MustNewEngine(c.NgConf)
|
||||
engine := rest.MustNewEngine(c.RtConf)
|
||||
defer engine.Stop()
|
||||
|
||||
handler.RegisterHandlers(engine)
|
||||
|
||||
@@ -3,7 +3,7 @@ package handler
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"zero/ngin/httpx"
|
||||
"zero/rest/httpx"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@@ -3,11 +3,11 @@ package handler
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"zero/ngin"
|
||||
"zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(engine *ngin.Engine) {
|
||||
engine.AddRoutes([]ngin.Route{
|
||||
func RegisterHandlers(engine *rest.Engine) {
|
||||
engine.AddRoutes([]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/",
|
||||
|
||||
Reference in New Issue
Block a user