INNER CODE UNIT · Go

init

CrunchyData/crunchy-containers · badger/badgerserver.go:31

func init() {
	log.SetOutput(os.Stdout)
	log.Println("BadgerServer starting..")
}

func main() {
	http.HandleFunc("/api/badgergenerate", BadgerGenerate)
	http.Handle("/static/", http.StripPrefix("/static", http.FileServer(http.Dir("/report"))))
	http.HandleFunc("/", RootPathRedirect)
	port := os.Getenv(PG_BADGER_SERVICE_PORT)
	if port == "" {
		log.Printf("PGBadger port not found. Using default %s\n", DEFAULT_PGBADGER_PORT)
		port = DEFAULT_PGBADGER_PORT
	}
	log.Fatal(http.ListenAndServe(":" + port, nil))
}

// BadgerGenerate perform a pgbadger to create the HTML output file

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…