forked from cloudfoundry/config-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
30 lines (24 loc) · 607 Bytes
/
main.go
File metadata and controls
30 lines (24 loc) · 607 Bytes
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
package main
import (
"fmt"
"os"
"github.com/cloudfoundry/config-server/config"
"github.com/cloudfoundry/config-server/log"
"github.com/cloudfoundry/config-server/server"
)
func main() {
defer log.Logger.HandlePanic("Main")
if len(os.Args) != 2 {
fmt.Fprintf(os.Stderr, "Usage: %s <config-file>\n", os.Args[0])
os.Exit(1)
}
config, err := config.ParseConfig(os.Args[1])
if err != nil {
panic("Unable to parse configuration file\n" + err.Error())
}
server := server.NewConfigServer(config)
err = server.Start()
if err != nil {
panic("Unable to start server\n" + err.Error())
}
}