You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mkdir backend
cd backend
go mod init your-project-name
go get github.com/webview/webview_go
Create your frontend folder using vite.
yarn create vite frontend
:: or
npm create vite@latest frontend
Write main.go, dev.go, and release.go.
// main.gopackage main
import webview "github.com/webview/webview_go"varw webview.WebViewfuncmain() {
// Create windowdebug:=truew=webview.New(debug)
deferw.Destroy()
// Set default size and title of the windoww.SetSize(800, 600, webview.HintNone)
w.SetTitle("your-project-name")
// Connect to the serverconnect()
// Bind functionsw.Bind("js_function", go_function)
...// Begin processw.Run()
}
// dev.go// +build !release <= NECESSARYpackage main
funcconnect() {
// Follow the port number of vite dev serverw.Navigate("http://localhost:5173")
}