Files
gf/geg/net/ghttp/server/https/https.go

15 lines
307 B
Go
Raw Normal View History

2018-04-23 19:22:59 +08:00
package main
import (
"github.com/gogf/gf/g/net/ghttp"
2018-04-23 19:22:59 +08:00
)
func main() {
s := ghttp.GetServer()
s.BindHandler("/", func(r *ghttp.Request){
2018-04-23 22:03:11 +08:00
r.Response.Writeln("来自于HTTPS的哈喽世界")
2018-04-23 19:22:59 +08:00
})
2019-03-19 17:48:37 +08:00
s.EnableHTTPS("./server.crt", "./server.key")
2018-04-23 19:22:59 +08:00
s.SetPort(8199)
s.Run()
}