mirror of
https://gitee.com/johng/gf
synced 2026-07-01 03:21:22 +08:00
17 lines
328 B
Go
17 lines
328 B
Go
package main
|
|
|
|
import (
|
|
"gitee.com/johng/gf/g"
|
|
"gitee.com/johng/gf/g/net/ghttp"
|
|
)
|
|
|
|
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:", id)
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
} |