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

18 lines
332 B
Go
Raw Normal View History

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