Replies: 2 comments 6 replies
-
It's embedded in the webui lib as array of bytes. js2c.py saves it to webui_bridge.h |
Beta Was this translation helpful? Give feedback.
5 replies
-
Hello, I have the same problem, with the Go binding: Here, I expected that webui.js is at http://localhost:5173/webui.js package main
import (
"fmt"
ui "github.com/webui-dev/go-webui/v2"
)
func greet(e ui.Event) string {
name, _ := ui.GetArg[string](e)
fmt.Printf("%s has reached the backend!\n", name)
jsResp := fmt.Sprintf("Hello %s 🐇", name)
return jsResp
}
func main() {
w := ui.NewWindow()
ui.Bind(w, "greet", greet)
w.ShowBrowser("http://localhost:5173", ui.Firefox)
ui.Wait()
} Here is the index.html, which is served in the 5173 via vite: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<titleLit component</title>
<script src="/webui.js"></script>
<script type="module" src="./my-element.js"></script>
</head>
<body>
<my-element></my-element>
</body>
</html> I can view the html inside the webui window, but the http://localhost:5173/webui.js do not exist. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
all main.c refers to webui.js and it looks like it's built from bridge/webui_bridge.ts, however I can run the examples without building the typescript file at all, how did the various "main" examples get its webui.js then?
Beta Was this translation helpful? Give feedback.
All reactions