-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
59 lines (47 loc) · 1.52 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
docs "github.com/Thrashy190/info-center-api/docs"
"github.com/Thrashy190/info-center-api/pkg/connection"
"github.com/Thrashy190/info-center-api/pkg/utils"
"github.com/Thrashy190/info-center-api/router"
"github.com/gin-gonic/gin"
swaggerfiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
func Initializers() {
utils.LoadEnvironment()
connection.Connection()
connection.GenerateSeed()
connection.ModelAutoMigrations()
}
// @Summary Information about L2_SF APIs
// @title Api Rest for information center
// @version 1.0
// @description This is The api for information center
// @termsOfService http://swagger.io/terms/
// @contact.name Thrashy190
// @contact.url https://thrashy190.github.io/
// @contact.email [email protected]
// @license.name MIT
// @license.url https://opensource.org/licenses/MIT
//
// @host localhost:8080
// @BasePath /
// @query.collection.format multi
func main() {
utils.Process("Connecting to 8080...")
r := gin.Default()
docs.SwaggerInfo.Title = "Information center API REST"
docs.SwaggerInfo.Description = "This is a API REST Documentation for the ITS Information Center"
docs.SwaggerInfo.Version = "1.0"
docs.SwaggerInfo.Host = "localhost:8080"
docs.SwaggerInfo.BasePath = "/"
utils.Success("Connection to localhost:8080 successfull")
Initializers()
router.SetupRouter(r, connection.DB)
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
err := r.Run(":8080")
if err != nil {
return
}
}