-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
48 lines (39 loc) · 959 Bytes
/
main.go
File metadata and controls
48 lines (39 loc) · 959 Bytes
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
package main
import (
"album/api"
"album/config"
"album/database"
"album/database/repositories"
"fmt"
"os"
_ "album/docs"
)
func init() {
fmt.Println(">>Initializing config<<")
config.LoadEnv()
repositories.DatabaseHandle()
database.Migrate()
}
/**
* use this link for Authorization
* https://github.com/swaggo/gin-swagger/issues/90#issuecomment-903813846
**/
// @title Go + Gin Album Rest API Service
// @version 1.0
// @description This is a sample server for save Albums in mysql database
// @contact.name API Support
// @contact.url http://www.swagger.io/api
// @contact.email api@swagger.io
// @license.name MIT
// @license.url https://opensource.org/licenses/MIT
// @host localhost:8070
// @BasePath /api
// @query.collection.format multi
// @securityDefinitions.apikey BearerAuth
// @in header
// @name Authorization
func main() {
var apiHost string = os.Getenv("API_HOST")
router := api.Routes()
router.Run(apiHost + ":8070")
}