func main() { glog.SetLogDirs(".") glog.SetLogToStderr(true) conf := controllers.Gconf beego.Get("/federation", func(ctx *context.Context) { federation(ctx, conf) }) beego.Get("/ripple.txt", func(ctx *context.Context) { f, err := os.Open("ripple.txt") if err != nil { glog.Fatal(err) } io.Copy(ctx.ResponseWriter, f) f.Close() }) beego.Get("/quote", func(ctx *context.Context) { u := "http://" + conf.Host + "/api/quote?" + ctx.Request.URL.RawQuery glog.Infoln(u) r, err := http.Get(u) if err != nil { glog.Errorln(err) return } io.Copy(ctx.ResponseWriter, r.Body) r.Body.Close() }) beego.Run() }
func main() { glog.SetLogDirs(".") glog.SetLogToStderr(true) routers.Init() beego.Run() }