mirror of
https://gitee.com/johng/gf
synced 2026-06-27 09:47:19 +08:00
23 lines
376 B
Go
23 lines
376 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
"io/ioutil"
|
|
)
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
s.SetIndexFolder(true)
|
|
s.BindHandler("/", func(r *ghttp.Request) {
|
|
body1 := r.GetBody()
|
|
body2, _ := ioutil.ReadAll(r.Body)
|
|
fmt.Println(body1)
|
|
fmt.Println(body2)
|
|
r.Response.Write("hello world")
|
|
})
|
|
s.SetPort(8999)
|
|
s.Run()
|
|
}
|