go-gallery/main.go
2018-04-18 14:16:29 +08:00

28 lines
449 B
Go

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()
_, err = models.NewDB()
if err != nil {
log.Fatal(err)
}
routes.SetDefaultRoutes(server)
server.Run(":10230")
}