mirror of https://github.com/ImVexed/muon.git
Update README.md
This commit is contained in:
parent
bd405e0f93
commit
04e5d36719
34
README.md
34
README.md
|
@ -34,37 +34,37 @@ From `examples/create-react-app/main.go`:
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/ImVexed/muon"
|
||||
"github.com/ImVexed/muon"
|
||||
|
||||
"cra-go/webfiles"
|
||||
"net/http"
|
||||
"cra-go/webfiles"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Any static asset packer of your liking (ex. fileb0x)
|
||||
fileHandler := http.FileServer(webfiles.HTTP)
|
||||
fileHandler := http.FileServer(webfiles.HTTP)
|
||||
|
||||
cfg := &muon.Config{
|
||||
Title: "Hello, World!",
|
||||
Height: 500,
|
||||
Width: 500,
|
||||
Hint: 2 | 4,
|
||||
}
|
||||
cfg := &muon.Config{
|
||||
Title: "Hello, World!",
|
||||
Height: 500,
|
||||
Width: 500,
|
||||
Hint: 2 | 4,
|
||||
}
|
||||
|
||||
m := muon.New(cfg, fileHandler)
|
||||
m := muon.New(cfg, fileHandler)
|
||||
|
||||
// Expose our `add` function to the JS runtime
|
||||
m.Bind("add", add)
|
||||
m.Bind("add", add)
|
||||
|
||||
// Show the Window and start the Runtime
|
||||
if err := m.Start(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := m.Start(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Muon automatically handles interop to and from the JS runtime
|
||||
func add(a float64, b float64) float64 {
|
||||
return a + b
|
||||
return a + b
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -77,4 +77,4 @@ func add(a float64, b float64) float64 {
|
|||
- JS: `Object` Go: `struct` via JSON
|
||||
|
||||
## Q: *I get `exit status 3221225781` when I try to run my program*
|
||||
- Your program likely can't find the [Ultralight](https://ultralig.ht/) libraries. Ensure they're either installed on the system, or, in the same folder as your program.
|
||||
- Your program likely can't find the [Ultralight](https://ultralig.ht/) libraries. Ensure they're either installed on the system, or, in the same folder as your program.
|
||||
|
|
Loading…
Reference in New Issue