-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (32 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
package main
import (
"log"
"net/http"
"github.com/XanderMoroz/mongoMovies/configs"
"github.com/XanderMoroz/mongoMovies/internal/routers"
_ "github.com/XanderMoroz/mongoMovies/docs"
)
// @title MonGorilla Project
// @version 1.0
// @description This is a sample server on Gorrilla Mux + MongoDB.
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email [email protected]
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @SecurityDefinitions.apiKey Bearer
// @in header
// @name Authorization
// @host 127.0.0.1:8080/
// // @BasePath /v1
func main() {
settings := configs.GetEnvConfig()
log.Println("Настраиваем подключение к MongoDB...")
configs.ConnectDB()
log.Println("...успешно")
r := routers.CommonRouter()
log.Println("=========== MonGorilla Start ============")
log.Println("== URL: http://127.0.0.1:8080/swagger/ ==")
log.Fatal(http.ListenAndServe(settings.AppPort, r))
}