We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
以下代码应该就可以使用 gin 了,没必要在底层引入 gin 吧,或者你看看有啥问题:
func main() { mux := &tars.TarsHttpMux{} e := gin.Default() e.GET("/hello", func(context *gin.Context) { context.JSON(200, gin.H{ "message": "Hello World", }) }) e.GET("/api/ping", func(context *gin.Context) { context.JSON(200, gin.H{ "message": "pong", }) }) for _, info := range e.Routes() { mux.Handle(info.Path, e.Handler()) } serverConfig := tars.GetServerConfig() objName := serverConfig.App + "." + serverConfig.Server + ".HttpObj" tars.AddHttpServant(mux, objName) tars.Run() }
新开个项目用了最新的 TarsGo,一看好家伙,好多依赖啊,还有些有安全问题,再一看全是 gin 导致的引入。
The text was updated successfully, but these errors were encountered:
又看了下,Path 中有参数的话会有问题,可这如果不想用 gin 的话白白引入了这么多的依赖
Sorry, something went wrong.
有更好的解耦方法吗? 欢迎pr
上面方法,参数路径还能使用吗?
Successfully merging a pull request may close this issue.
以下代码应该就可以使用 gin 了,没必要在底层引入 gin 吧,或者你看看有啥问题:
新开个项目用了最新的 TarsGo,一看好家伙,好多依赖啊,还有些有安全问题,再一看全是 gin 导致的引入。
The text was updated successfully, but these errors were encountered: