| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

Web 框架:Gin Web Framework

Gin 是一个用 Go 语言开发的 Web 框架,提供类 Martini 的 API,但是性能更好。因为有了 httprouter 性能提升了 40 倍之多。 你如需要一个高性能,高开发效率的框架,那么Gin刚好适合你。

Web 框架:Gin Web Framework

$ cat test.go
package main    import (      "net/http"      "github.com/gin-gonic/gin"  )    func main() {      router := gin.Default()      router.GET("/", func(c *gin.Context) {          c.String(http.StatusOK, "hello world")      })      router.GET("/ping", func(c *gin.Context) {          c.String(http.StatusOK, "pong")      })      router.POST("/submit", func(c *gin.Context) {          c.String(http.StatusUnauthorized, "not authorized")      })      router.PUT("/error", func(c *gin.Context) {          c.String(http.StatusInternalServerError, "an error happened :(")      })      router.Run(":8080")  }

项目主页:http://www.open-open.com/lib/view/home/1431650672513

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1431650672513.html
Web框架 Gin Web Framework