package main

import (
	"log"

	"git.trj.tw/golang/go-gallery/models"
	"git.trj.tw/golang/go-gallery/modules/memstore"
	"git.trj.tw/golang/go-gallery/routers/routes"
	"github.com/gin-gonic/gin"
)

var server *gin.Engine

func main() {
	err := memstore.InitClient()
	if err != nil {
		log.Fatal(err)
	}
	server = routes.NewServ()
	x, err := models.NewDB()
	defer x.Close()
	if err != nil {
		log.Fatal(err)
	}
	routes.SetDefaultRoutes(server)

	server.Run(":10230")
}
