Change to built in http

This commit is contained in:
Supan Adit Pratama 2020-11-24 12:12:27 +07:00
parent 37b10df949
commit db576e7c1e

View File

@ -6,6 +6,8 @@ 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"
"log"
"net/http"
) )
func main() { func main() {
@ -20,5 +22,7 @@ func main() {
system.Router(r, client) system.Router(r, client)
// Run Server // Run Server
// _ = r.Run(fmt.Sprintf(":%s", system.ServerPort)) // _ = r.Run(fmt.Sprintf(":%s", system.ServerPort))
_ = r.RunTLS(fmt.Sprintf(":%s", system.ServerPort), "./server.crt", "./server.key") // _ = r.RunTLS(fmt.Sprintf(":%s", system.ServerPort), "./server.crt", "./server.key")
err := http.ListenAndServeTLS(fmt.Sprintf(":%s", system.ServerPort), "cert.pem", "key.pem", nil)
log.Fatal(err)
} }