routers.go 473 B

12345678910111213141516171819202122232425262728
  1. package core
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. func setJsRpcRouters(router *gin.Engine) {
  6. // 核心部分的的路由组
  7. router.GET("/", index)
  8. page := router.Group("/page")
  9. {
  10. page.GET("/cookie", GetCookie)
  11. page.GET("/html", GetHtml)
  12. }
  13. rpc := router.Group("/")
  14. {
  15. rpc.GET("go", getResult)
  16. rpc.POST("go", getResult)
  17. rpc.GET("ws", ws)
  18. rpc.GET("wst", wsTest)
  19. rpc.GET("execjs", execjs)
  20. rpc.POST("execjs", execjs)
  21. rpc.GET("list", getList)
  22. }
  23. }