Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 622 Bytes
package main // import "go.uber.org/sally"
import (
"flag"
"fmt"
"log"
"net/http"
)
func main() {
yml := flag.String("yml", "sally.yaml", "yaml file to read config from")
port := flag.Int("port", 8080, "port to listen and serve on")
flag.Parse()
log.Printf("Parsing yaml at path: %s\n", *yml)
config, err := Parse(*yml)
if err != nil {
log.Fatalf("Failed to parse %s: %v", *yml, err)
}
log.Printf("Creating HTTP handler with config: %v", config)
handler := CreateHandler(config)
log.Printf(`Starting HTTP handler on ":%d"`, *port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), handler))
}
You can’t perform that action at this time.