func setupServant() *FunServantImpl { server.SetupLogging(".canbedeleted.test.log", "info", "", "", "") cf, _ := conf.Load("../etc/faed.cf") config.LoadEngineConfig(cf) server.LaunchHttpServer(":9999", "") return NewFunServant(config.Engine.Servants) }
func (this *Engine) launchHttpServ() { if config.Engine.HttpListenAddr == "" { return } server.LaunchHttpServer(config.Engine.HttpListenAddr, config.Engine.PprofListenAddr) server.RegisterHttpApi("/h", func(w http.ResponseWriter, req *http.Request, params map[string]interface{}) (interface{}, error) { return this.handleHttpHelpQuery(w, req, params) }).Methods("GET") server.RegisterHttpApi("/help", func(w http.ResponseWriter, req *http.Request, params map[string]interface{}) (interface{}, error) { return this.handleHttpHelpQuery(w, req, params) }).Methods("GET") server.RegisterHttpApi("/engine/{cmd}", func(w http.ResponseWriter, req *http.Request, params map[string]interface{}) (interface{}, error) { return this.handleHttpQuery(w, req, params) }).Methods("GET") }