mirror of
https://github.com/supanadit/geo-smart-system.git
synced 2024-11-10 01:52:24 +00:00
27 lines
690 B
Go
27 lines
690 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gin-contrib/cors"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/go-redis/redis"
|
|
"github.com/supanadit/geo-smart-system/system"
|
|
)
|
|
|
|
func main() {
|
|
// Create Connection with Tile 38
|
|
client := redis.NewClient(&redis.Options{
|
|
Addr: system.GetTile38ConnectionAddress(),
|
|
})
|
|
// Create Gin Engine
|
|
r := gin.Default()
|
|
r.Use(cors.Default())
|
|
// Call Router
|
|
system.Router(r, client)
|
|
// Run Server
|
|
_ = r.Run(fmt.Sprintf(":%s", system.ServerPort))
|
|
// _ = 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)
|
|
}
|