add: 模仿gin框架

This commit is contained in:
2022-02-13 11:46:56 +08:00
parent 6633420cf6
commit ea348b07a6
4 changed files with 71 additions and 4 deletions

View File

@@ -13,9 +13,13 @@ func main() {
c.String(200, "hello,%v", c.Query("name"))
})
engine.POST("/login", func(c *gee.Context) {
//c.JSON(200, gee.H{
// "username": "xxxx",
// "password": "1234",
//})
c.JSON(200, gee.H{
"username": "xxxx",
"password": "1234",
"username": c.PostForm("username"),
"password": c.PostForm("password"),
})
})
_ = engine.Run(":9000")