github.com/gogf/gf@v1.16.9/.example/net/ghttp/server/reload/https.go (about) 1 package main 2 3 import ( 4 "github.com/gogf/gf/frame/g" 5 "github.com/gogf/gf/net/ghttp" 6 ) 7 8 func main() { 9 s := g.Server() 10 s.BindHandler("/", func(r *ghttp.Request) { 11 r.Response.Writeln("哈罗!") 12 }) 13 s.EnableHTTPS("/home/john/temp/server.crt", "/home/john/temp/server.key") 14 s.EnableAdmin() 15 s.SetPort(8200) 16 s.Run() 17 }