3 ms·
You can do this with github.com/webview/webview bindings. - Golang server - Use go:embed to embed the public folder of the frontend - Open a webview pointing
by cookiengineer 4y ago
You can do this with github.com/webview/webview bindings.
- Golang server
- Use go:embed to embed the public folder of the frontend
- Open a webview pointing to localhost:ephermal port
Easy as pie, and less than a couple of kilobytes overhead.
- stopyellingatme 4y agoI like the simplicity of this solution. Could you expand on it? Any examples?
- deleted 4y ago[deleted]
- schemescape 4y agoI think Neutralino uses a similar architecture (without Go, obviously).
- EGreg 4y agoWill it work on windows though? Without any special installer permissions?
- cookiengineer 4y agoGolang can compile to windows statically, and on Windows those bindings are using the MSWebView2 API (aka Microsoft Edge webview). I know that you can also compile the webview.cc into a dll specifically, and link against that. But I'd never done with Visual C++ because I am cross-compiling from Linux to Windows. The README of the webview/webview project refers to the WebView2 SDK on NuGet, however [1] [1] https://github.com/webview/webview#windows-preparation https://github.com/webview/webview#windows-preparation
- tensor 4y agoOr even easier: https://wails.io https://wails.io. Uses Go, webview, and handles a lot of the build and hot reloading for you.
- deleted 4y ago[deleted]