47 lines
797 B
Go
47 lines
797 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/wailsapp/wails/v2"
|
|
"github.com/wailsapp/wails/v2/pkg/options"
|
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
|
)
|
|
|
|
//go:embed all:frontend components
|
|
var assets embed.FS
|
|
|
|
//go:embed build/appicon.png
|
|
var icon []byte
|
|
var version = "0.0.0"
|
|
|
|
func main() {
|
|
app := NewApp()
|
|
router := NewRouter()
|
|
|
|
err := wails.Run(&options.App{
|
|
Title: "snackbar",
|
|
Width: 1040,
|
|
Height: 768,
|
|
StartHidden: true,
|
|
AssetServer: &assetserver.Options{
|
|
Assets: assets,
|
|
Middleware: func(next http.Handler) http.Handler {
|
|
router.NotFound(next.ServeHTTP)
|
|
return router
|
|
},
|
|
},
|
|
OnStartup: app.startup,
|
|
OnShutdown: app.shutdown,
|
|
Bind: []interface{}{
|
|
app,
|
|
},
|
|
})
|
|
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|