2019-10-01 21:38:14 -05:00
|
|
|
//go:generate fileb0x b0x.yml
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-10-01 21:59:10 -05:00
|
|
|
"github.com/ImVexed/muon"
|
|
|
|
|
|
|
|
"cra-go/webfiles"
|
|
|
|
"net/http"
|
2019-10-01 21:38:14 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
fileHandler := http.FileServer(webfiles.HTTP)
|
|
|
|
|
|
|
|
cfg := &muon.Config{
|
2019-10-07 19:32:38 -05:00
|
|
|
Title: "Hello, World!",
|
|
|
|
Height: 500,
|
|
|
|
Width: 500,
|
2019-10-08 22:02:46 -05:00
|
|
|
Titled: true,
|
2019-10-07 19:32:38 -05:00
|
|
|
Resizeable: true,
|
2019-10-01 21:38:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m := muon.New(cfg, fileHandler)
|
|
|
|
|
|
|
|
m.Bind("add", add)
|
|
|
|
|
|
|
|
if err := m.Start(); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func add(a float64, b float64) float64 {
|
|
|
|
return a + b
|
|
|
|
}
|