思路:
- 写个vue,打包
- gin服务映射
- 这个开源包就是个壳子,把上面两个包起来
代码:
package main
import (
"github.com/gin-gonic/gin"
"net/http"
"github.com/zserge/lorca"
)
func main() {
go func() {
r := gin.Default()
r.StaticFS("/web", http.Dir("./dist"))
r.Run("0.0.0.0:4000")
}()
ui, _ := lorca.New("", "", 480, 320)
defer ui.Close()
ui.Load("http://127.0.0.1:4000/web")
// Wait for the browser window to be closed
<-ui.Done()
}
请发表评论