-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (32 loc) · 1 KB
/
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
package main
import (
"log"
"github.com/JOIN-M-Y/server/account"
"github.com/JOIN-M-Y/server/address"
"github.com/JOIN-M-Y/server/config"
"github.com/JOIN-M-Y/server/file"
"github.com/JOIN-M-Y/server/profile"
"github.com/JOIN-M-Y/server/request"
"github.com/JOIN-M-Y/server/study"
"github.com/JOIN-M-Y/server/util"
"github.com/gin-gonic/gin"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
// @securityDefinitions.apikey AccessToken
// @in header
// @name Authorization
func main() {
config := config.Initialize()
util := util.Initialize()
gin.SetMode(config.Server().Mode())
route := gin.Default()
account.Initialize(route, config, util)
file.Initialize(route, config, util)
profile.Initialize(route, config, util)
address.Initialize(route, config, util)
study.Initialize(route, config, util)
request.Initialize(route, config, util)
route.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
log.Fatal(route.Run(":" + config.Server().Port()))
}