-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
45 lines (34 loc) · 931 Bytes
/
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 (
"flag"
"github.com/gin-gonic/gin"
"github.com/goproducts/config"
"github.com/goproducts/data"
"github.com/goproducts/database"
_ "github.com/goproducts/docs"
"github.com/goproducts/server"
)
var r *gin.Engine
// @title GoProducts Example Project
// @version 1.0
// @description This is a sample for using Go, DynamoDB, and CloudSearch
// @contact.name Daniel Rehner
// @contact.url http://www.twitter.com/danielrehner
// @contact.email daniel.rehner@gmail.com
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @BasePath /api/v1
func main() {
environment := flag.String("e", "development", "")
flag.Parse()
config.InitializeEnvironment(*environment)
db := &database.DB{
Client: database.GetClient(),
}
search := &database.Search{
Client: database.GetSearchClient(),
}
data.SetupData(db)
r := server.SetupRouter(db, search)
r.Run()
}