路由
目前框架只提供了http通信,可以让前端
electron进程
与之通信;其它通信方式正在开发中...
# router
定义http路由与方法绑定。
# 使用方法
package router
import (
"electron-egg/api"
eRouter "github.com/wallace5303/ee-go/ehttp/router"
)
func Api() {
// 注册路由
eRouter.Handle("GET", "/api/hello", api.Hello)
eRouter.Handle("GET", "/api/exit", api.Exit)
// 使用 gin 注册路由
// GinRouter是 gin.New() 创建的实例,因此你可以使用gin的所有功能
eRouter.GinRouter.GET("/api/info", api.Info)
}
上次更新: 2025/04/10, 03:07:49