-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (36 loc) · 1.07 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
package main
import (
"./app"
"github.com/joho/godotenv"
"log"
"os"
)
// @title Fantasy football manager API
// @version 1.0
// @description Fantasy football manager microservice.
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @BasePath /api/
// @securityDefinitions.apiKey BearerAuth
// @in header
// @tokenUrl POST "/session"
// @name Authorization
// @scope.write Grants read and write access to user information
// @scope.admin Grants read and write access to administrative information
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
application, err := app.CreateApp("localhost:8080", os.Getenv("DB_HOST"), os.Getenv("DB_USER"), os.Getenv("DB_PASSWORD"), os.Getenv("DB_NAME"), os.Getenv("DB_PORT"))
if err != nil {
log.Fatal("Failed to start app")
}
defer application.Close()
application.Run()
}