1 Star 0 Fork 0

径年丶 / go-saym

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 479 Bytes
一键复制 编辑 原始数据 按行查看 历史
径年丶 提交于 2020-11-17 14:38 . router
package main
import (
"net/http"
"saym"
)
func main() {
r := saym.New()
r.GET("/", func(ctx *saym.Context) {
ctx.Html(http.StatusOK, "<h1>hello saym</h1>")
})
//r.GET("/hello", func(ctx *saym.Context) {
// ctx.String(http.StatusOK, "hello %s, you're at %s\n", ctx.Query("name"), ctx.Path)
//})
api := r.Group("/api")
api.GET("/login", func(ctx *saym.Context) {
ctx.JSON(http.StatusOK, saym.H{
"account": "1896",
"pwd": "pwd",
})
})
r.Run(":8888")
}
Go
1
https://gitee.com/saym_lzq/go-saym.git
git@gitee.com:saym_lzq/go-saym.git
saym_lzq
go-saym
go-saym
master

搜索帮助