Ejemplo n.º 1
0
func main() {

	configFile, _ := os.Open("example/config.json")
	jsonParser := json.NewDecoder(configFile)
	var configuration config.Config
	_ = jsonParser.Decode(&configuration)

	configuration.SelectorFunctions = make(map[string]config.BackendSelectorFunction)
	configuration.SelectorFunctions["selectGoogle"] = selectGoogle

	server.Start(8000, &configuration)
}
Ejemplo n.º 2
0
func StartPageCompositionServer(port int, hostname string, eventHandler func(), configFileName string) {

	if configFileName == "" {
		configFileName = "testConfig"
	}

	configFilePath := "../common/" + configFileName + ".json"

	configFile, _ := os.Open(configFilePath)

	jsonParser := json.NewDecoder(configFile)
	var configuration config.Config
	_ = jsonParser.Decode(&configuration)

	configuration.SelectorFunctions = make(map[string]config.BackendSelectorFunction)

	portString := ":" + strconv.Itoa(port)
	log.Printf("Starting Gongeal Server at Port: %v\n", portString)

	server.Start(port, &configuration)
}