-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (33 loc) · 692 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* @Descripttion:
* @version:
* @Author: yyeiei
* @Date: 2019-08-12 10:34:32
* @LastEditors: yyeiei
* @LastEditTime: 2019-08-16 17:39:01
*/
package main
import (
"fmt"
"math/rand"
"time"
"libra/models"
"libra/pkg/conf"
"libra/pkg/logger"
"libra/routers"
_ "libra/docs" // docs is generated by Swag CLI, you have to import it.
"github.com/gin-gonic/gin"
)
func init() {
go rand.Seed(time.Now().UnixNano())
conf.Setup()
logger.Setup(conf.Configs.Log.Path)
models.Setup()
// models.SyncDataBase()
}
func main() {
gin.SetMode(conf.Configs.Server.RunMode)
router := gin.Default()
routers.Regist(router)
router.Run(fmt.Sprintf(":%d", conf.Configs.Server.Port))
}