-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
45 lines (34 loc) · 832 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"
"os"
//"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/degaurab/gpdb-adapter/api"
)
////CatalogPath for testing
//const CatalogPath = "/tmp/catalog.yml"
////ConfigPath for testing
//const ConfigPath = "/tmp/service-config.yml"
//
func main() {
log := log.New(os.Stderr, "[gbpd-service-adapter]", log.LstdFlags)
configPath := flag.String(
"config",
"/tmp/service-config.yml",
"Path for service-config.yml",
)
catalogPath := flag.String(
"catalog",
"/tmp/catalog.yml",
"Path for catalog.yml",
)
flag.Parse()
log.Println("ConfigPath:", *configPath, "::", "CatalogPath:", *catalogPath)
r := mux.NewRouter()
api.NewApiHandler(log, *configPath, *catalogPath, r)
log.Println("Server Started. Listning on :8080")
log.Fatal(http.ListenAndServe(":8080", r))
}