mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 05:07:44 +08:00
19 lines
359 B
Go
19 lines
359 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
"github.com/gogf/gf/os/gtime"
|
|
)
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
s.BindHandler("/cookie", func(r *ghttp.Request) {
|
|
datetime := r.Cookie.Get("datetime")
|
|
r.Cookie.Set("datetime", gtime.Datetime())
|
|
r.Response.Write("datetime:", datetime)
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|