예제 #1
0
파일: route.go 프로젝트: ifzz/stockrecorder
//	注册路由
func registerRoute(e *echo.Echo) {

	e.Get("/", welcome)
	e.Favicon("favicon.ico")

	e.Get("/:market/:code/:start/:end/1m", queryPeroid60)
}
예제 #2
0
func SetupKeysRoutes(e *echo.Echo) {
	e.Get("", listKeys)
	e.Get("/:id", showKey)
	e.Post("", createKey)
	e.Put("/:id", updateKey)
	e.Delete("/:id", deleteKey)
}
예제 #3
0
// RegisterRoutes sets up the http request handlers with Echo
func RegisterRoutes(e *echo.Echo, db *mgo.Database, basePieURL string, service service.RiskService, fnDelayer *FunctionDelayer) {
	e.Get("/pies/:id", func(c *echo.Context) (err error) {
		pie := &plugin.Pie{}
		id := c.Param("id")
		if bson.IsObjectIdHex(id) {
			query := db.C("pies").FindId(bson.ObjectIdHex(id))
			err = query.One(pie)
			if err == nil {
				c.JSON(200, pie)
			}
		} else {
			c.String(400, "Bad ID format for requested Pie. Should be a BSON Id")
		}
		return
	})

	e.Post("/calculate", func(c *echo.Context) (err error) {
		patientID := c.Form("patientId")
		fhirEndpointURL := c.Form("fhirEndpointUrl")
		key := fmt.Sprintf("%s@%s", patientID, fhirEndpointURL)
		fnDelayer.Delay(key, func() {
			service.Calculate(patientID, fhirEndpointURL, basePieURL)
		})
		return
	})
}
예제 #4
0
func InitRoutes(e *echo.Echo) {
	h := new(handler)
	e.Get("/json", h.json())
	e.Get("/db", h.db())
	e.Get("/queries/*", h.queries())
	e.Get("/fortunes", h.fortunes())
	e.Get("/updates/*", h.updates())
	e.Get("/plaintext", h.plaintext())
}
예제 #5
0
파일: server.go 프로젝트: wkjagt/skeletor
func registerClient(e *echo.Echo) {
	e.Get("/bundle.js", func(c *echo.Context) error {
		return c.File("../client/bundle.js", "", false)
	})

	e.Get("/", func(c *echo.Context) error {
		return c.File("../client/index.html", "", false)
	})
}
예제 #6
0
파일: router.go 프로젝트: sheercat/evaltmpl
func Set(e *echo.Echo) *echo.Echo {

	e.Favicon("static/favicon.ico")
	e.Static("/", "static")

	e.Get("/", controller.Index)
	e.Get("/eval/", controller.Eval)
	e.Post("/eval/", controller.PostEval)

	return e
}
예제 #7
0
파일: handlers.go 프로젝트: cedmundo/site
// Configure setups routes and templates
func Configure(r *render.BufferedRender, e *echo.Echo) error {
	// Add templates
	err := r.Load("500", utils.TmplAbs("500.tmpl"), utils.TmplAbs("layouts", "black_base.tmpl"))
	if err != nil {
		return err
	}

	e.SetHTTPErrorHandler(HandleError)
	e.Get("/500", FailOnPropouse)

	// Add routes
	return nil
}
예제 #8
0
파일: web.go 프로젝트: xperimental/yovpn
func (s *yovpnServer) setupHandlers(e *echo.Echo) {
	e.Get("/", s.blank)
	e.Get("/cleanup", s.cleanup)

	e.Put("/endpoint", s.createEndpoint)
	e.Get("/endpoint/:id", s.getEndpoint)
	e.Delete("/endpoint/:id", s.deleteEndpoint)

	e.Get("/regions", s.getRegions)
}
예제 #9
0
파일: router.go 프로젝트: schaffers/typed
func registerRouterHandler(e *echo.Echo) {
	e.Get("/users/:id", func(c *echo.Context) error {
		return c.String(http.StatusOK, "/users/"+c.Param("id"))
	})
	e.Get("/:id", func(c *echo.Context) error {
		return c.String(http.StatusOK, "/"+c.Param("id"))
	})
	e.Get("/post/:id", func(c *echo.Context) error {
		return c.String(http.StatusOK, getPost(c.Param("id")))
	})
	e.Get("/welcome", welcome)
}
func SetupDropletActionsRoutes(e *echo.Echo) {
	e.Get("/:actionId", getDropletAction)
	e.Post("/disable_backups", disableDropletBackups)
	e.Post("/reboot", rebootDroplet)
	e.Post("/power", powerCycleDroplet)
	e.Post("/shutdown", shutdownDroplet)
	e.Post("/power_off", powerOffDroplet)
	e.Post("/power_on", powerOnDroplet)
	e.Post("/restore", restoreDroplet)
	e.Post("/password_reset", passwordResetDroplet)
	e.Post("/resize", resizeDroplet)
	e.Post("/rebuild", rebuildDroplet)
	e.Post("/rename", renameDroplet)
	e.Post("/change_kernel", changeDropletKernel)
	e.Post("/enable_ipv6", enableDropletIPv6)
	e.Post("/enable_private_networking", enableDropletPrivateNetworking)
	e.Post("/snapshot", snapshotDroplet)
	e.Post("/upgrade", upgradeDroplet)
}
예제 #11
0
파일: handlers.go 프로젝트: cedmundo/site
// Configure setups routes and templates
func Configure(r *render.BufferedRender, e *echo.Echo) error {
	// Add templates
	err := r.Load("legal_document", utils.TmplAbs("legal_document.tmpl"), utils.TmplAbs("layouts", "black_base.tmpl"))
	if err != nil {
		return err
	}

	// Add routes
	e.Get("/legal/licenses/:slug", Licenses)
	e.Get("/legal/terms-of-uses/:slug", UseTerms)
	e.Get("/legal/privacy-policies/:slug", PrivacyPolicies)
	return nil
}
예제 #12
0
func routes(e *echo.Echo) {
	e.Get("/products", rest.GetProducts)
}
예제 #13
0
func createUsersRoutes(e *echo.Echo) {
	e.Post("/users", createUser)
	e.Get("/users", getUsers)
	e.Get("/users/:id", getUser)
}
예제 #14
0
파일: api.go 프로젝트: wvdeutekom/GoQuotes
func Route(e *echo.Echo, a *AppContext) {
	//Quotes
	e.Post("/quotes", a.NewQuote)
	e.Get("/quotes", a.GetQuotes)
	e.Get("/quotes/:id", a.FindOneQuote)
	e.Put("/quotes/:id", a.EditQuote)
	e.Delete("/quotes/:id", a.DeleteQuote)

	//Slack specific api calls, uses incoming x-www-form-urlencoded post data instead of json
	e.Post("/slack/insertQuote", a.NewQuote)
	e.Get("/slack/searchQuote", a.SearchQuote)

	//Activity feed
	e.Post("/activities", a.NewActivity)
	e.Get("/activities", a.GetActivities)
	e.Get("/activities/:id", a.FindOneActivity)
	e.Delete("/activities/:id", a.DeleteActivity)

	//Debug
	e.Get("/debug", a.SendQuote)
}
예제 #15
0
func Wrap(e *echo.Echo) {
	e.Get("/debug/pprof/", IndexHandler)
	e.Get("/debug/pprof/heap", HeapHandler)
	e.Get("/debug/pprof/goroutine", GoroutineHandler)
	e.Get("/debug/pprof/block", BlockHandler)
	e.Get("/debug/pprof/threadcreate", ThreadCreateHandler)
	e.Get("/debug/pprof/cmdline", CmdlineHandler)
	e.Get("/debug/pprof/profile", ProfileHandler)
	e.Get("/debug/pprof/symbol", SymbolHandler)
}
예제 #16
0
func loadHandlers(e *echo.Echo) {

	if itrak.Debug {
		e.SetDebug(true)
	}

	// Point to the client application generated inside the webapp dir
	e.Index("./webapp/build/index.html")
	e.ServeDir("/", "./webapp/build/")

	server_stats = stats.New()
	e.Use(server_stats.Handler)

	e.Get("/stats", getStats)
	e.Get("/test1", getTestData)
	e.Get("/part", getPartsList)
	e.Get("/task", getTaskList)
	e.Get("/jtask", getJTaskList)

	e.Post("/login", login)
	e.Delete("/login", logout)

	e.Get("/people", getPeople)
	e.Get("/people/:id", getPerson)
	e.Post("/people/:id", savePerson)

	e.Get("/site", getSites)
	e.Get("/site/:id", getSite)
	e.Post("/site/:id", saveSite)

	e.Get("/roles", getRoles)

	e.Get("/vendors", getAllVendors)
	e.Post("/vendors/:id", saveVendor)

	// Equipment Related functions
	e.Get("/equipment", getAllEquipment)
	e.Get("/site_equipment/:id", getAllSiteEquipment)
	e.Get("/equipment/:id", getEquipment)
	e.Post("/equipment/:id", saveEquipment)
	e.Get("/subparts/:id", subParts)
	e.Get("/spares", getAllSpares)
	e.Get("/spares/:id", getEquipment)
	e.Post("/spares/:id", saveEquipment)
	e.Get("/consumables", getAllConsumables)
	e.Get("/consumables/:id", getEquipment)
	e.Post("/consumables/:id", saveEquipment)

	e.Get("/equiptype", getAllEquipTypes)
	e.Get("/equiptype/:id", getEquipType)
	e.Post("/equiptype/:id", saveEquipType)

	e.Get("/task", getAllTask)
	e.Get("/sitetask/:id", getSiteTasks)
	e.Get("/task/:id", getTask)
	e.Post("/task/:id", saveTask)
}
func SetupImageActionsRoutes(e *echo.Echo) {
	e.Get("/:actionId", getImageAction)
	e.Post("/transfer", transferImage)
	e.Post("/convert", convertImage)
}
예제 #18
0
func Init(e *echo.Echo) {
	e.Get("/api/todos", todocontroller.GetAll)
	e.Post("/api/todos", todocontroller.NewTodo)
	e.Delete("/api/todos/:id", todocontroller.RemoveTodo)
}
예제 #19
0
func mountVersionRoutes(server *echo.Echo) {
	server.Get("/", getVersion)
}
예제 #20
0
func SetupSizesRoutes(e *echo.Echo) {
	e.Get("", listSizes)
}
예제 #21
0
파일: api.go 프로젝트: boourns/skeletor
func registerAPI(e *echo.Echo) {
	e.Get("/api/hello", hello)
	e.Post("/api/form", formHandler)
}
예제 #22
0
파일: main.go 프로젝트: twanies/gonzo
func registerAuthHandlers(router *echo.Echo, authService handler.AuthService) {
	router.Get("/test", authService.Show)
}
예제 #23
0
func createDocsRoute(e *echo.Echo) {
	for apiKey, _ := range apiDescriptionsJson {
		e.Get("/docs/"+apiKey, apiDescriptionHandler)
	}
}
예제 #24
0
// Setup routes for droplet actions
func SetupDropletsRoutes(e *echo.Echo) {
	e.Get("", listDroplets)
	e.Get("/:id", showDroplet)
	e.Post("", createDroplet)
	e.Delete("/:id", deleteDroplet)
	e.Get("/:id/kernels", listDropletKernels)
	e.Get("/:id/snapshots", listDropletSnapshots)
	e.Get("/:id/backups", listDropletBackups)
	e.Get("/:id/actions", listDropletActions)
	e.Get("/:id/neighbors", listDropletNeighbors)
}
예제 #25
0
func SetupRegionsRoutes(e *echo.Echo) {
	e.Get("", listRegions)
}
예제 #26
0
func SetupActionsRoutes(e *echo.Echo) {
	e.Get("", listActions)
	e.Get("/:id", showAction)
}
예제 #27
0
파일: user.go 프로젝트: holys/rice
func RegisterHandlers(r *echo.Echo) {
	h := &UserHandler{}
	r.Get("/", h.Hello)
}
예제 #28
0
파일: handlers.go 프로젝트: cedmundo/site
// Configure setups routes and templates
func Configure(r *render.BufferedRender, e *echo.Echo) error {
	// Add templates
	err := r.Load("index", utils.TmplAbs("index.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("post", utils.TmplAbs("post.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("archive", utils.TmplAbs("archive.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("category", utils.TmplAbs("category.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("profile", utils.TmplAbs("profile.tmpl"), utils.TmplAbs("layouts", "red_base.tmpl"))
	if err != nil {
		return err
	}

	err = r.Load("contact", utils.TmplAbs("contact.tmpl"), utils.TmplAbs("layouts", "blog.tmpl"))
	if err != nil {
		return err
	}

	// Add routes
	e.Get("/", Index)
	e.Get("/posts/:id", PostView)
	e.Get("/categories/:id", CategoryView)
	e.Get("/archive/:id", ArchiveView)
	e.Get("/profiles/:id", ProfileView)
	e.Post("/posts/:id/comments", AddComment)
	e.Get("/contact", ContactView)
	e.Post("/contact", DoContact)
	return nil
}
예제 #29
0
func SetupImagesRoutes(e *echo.Echo) {
	e.Get("", listImages)
	e.Get("/:id", showImage)
}