geo-smart-system/main.go

24 lines
509 B
Go
Raw Normal View History

2019-10-19 16:38:38 +00:00
package main
import (
"github.com/gin-contrib/cors"
2020-11-24 04:36:21 +00:00
"github.com/gin-gonic/autotls"
2019-10-19 16:38:38 +00:00
"github.com/gin-gonic/gin"
"github.com/go-redis/redis"
2020-01-04 00:44:42 +00:00
"github.com/supanadit/geo-smart-system/system"
2019-10-19 16:38:38 +00:00
)
func main() {
2020-01-04 00:44:42 +00:00
// Create Connection with Tile 38
2019-10-19 16:38:38 +00:00
client := redis.NewClient(&redis.Options{
2020-01-04 00:44:42 +00:00
Addr: system.GetTile38ConnectionAddress(),
2019-10-19 16:38:38 +00:00
})
2020-01-04 00:44:42 +00:00
// Create Gin Engine
2019-10-27 16:34:34 +00:00
r := gin.Default()
r.Use(cors.Default())
2020-01-04 00:44:42 +00:00
// Call Router
system.Router(r, client)
// Run Server
2020-11-24 04:40:12 +00:00
_ = autotls.Run(r, "api.geosmart.supanadit.com")
2019-10-19 16:38:38 +00:00
}