mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 05:07:44 +08:00
19 lines
340 B
Go
19 lines
340 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
"github.com/gogf/gf/util/gconv"
|
|
)
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
s.BindHandler("/session", func(r *ghttp.Request) {
|
|
id := r.Session.GetInt("id")
|
|
r.Session.Set("id", id+1)
|
|
r.Response.Write("id:" + gconv.String(id))
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|