mirror of
https://github.com/supanadit/geo-smart-system.git
synced 2024-11-10 01:52:24 +00:00
Change AutoTLS
This commit is contained in:
parent
5ddfc92f0c
commit
19cf1f4ad7
10
main.go
10
main.go
@ -6,8 +6,6 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-redis/redis"
|
"github.com/go-redis/redis"
|
||||||
"github.com/supanadit/geo-smart-system/system"
|
"github.com/supanadit/geo-smart-system/system"
|
||||||
"golang.org/x/crypto/acme/autocert"
|
|
||||||
"log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -21,11 +19,5 @@ func main() {
|
|||||||
// Call Router
|
// Call Router
|
||||||
system.Router(r, client)
|
system.Router(r, client)
|
||||||
// Run Server
|
// Run Server
|
||||||
m := autocert.Manager{
|
_ = autotls.Run(r, "api.geosmart.supanadit.com")
|
||||||
Prompt: autocert.AcceptTOS,
|
|
||||||
HostPolicy: autocert.HostWhitelist(),
|
|
||||||
Cache: autocert.DirCache("/var/www/.cache"),
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Fatal(autotls.RunWithManager(r, &m))
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user