-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
45 lines (36 loc) · 1.04 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
package main
import (
"collagen/config/database"
"collagen/routes/central_router"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"log"
)
// @title Collagen Web Service
// @version 1.0
// @description Web service API in Go using Gin framework.
// @termsOfService https://tos.santoshk.dev
// @contact.name M Nurilman Baehaqi
// @contact.url https://twitter.com/MOXSPOY
// @contact.email [email protected]
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8083
// @BasePath /api/v1
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
// @description Description for what is this security definition being used
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
database.SetupDatabase()
router := gin.Default()
central_router.RegisterAllRouter(router)
err = router.Run("localhost:8083")
if err != nil {
log.Fatal("Error while running server")
}
}