-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
23 lines (17 loc) · 652 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
package main
import (
"os"
"example/server"
"example/types"
"github.com/namsral/flag"
)
var config types.Config
func main() {
flag.CommandLine = flag.NewFlagSetWithEnvPrefix(os.Args[0], "RES", flag.ExitOnError)
flag.IntVar(&config.Port, "port", 8080, "Port that server will listen on")
flag.StringVar(&config.HotelsURL, "hotels-url", "http://localhost:8081", "URL of the hotels uservice")
flag.StringVar(&config.UsersURL, "users-url", "http://localhost:8082", "URL of the users uservice")
flag.StringVar(&config.DSN, "dsn", "postgres://postgres:@localhost:8083/test?sslmode=disable", "databse DSN")
flag.Parse()
server.Serve(config)
}