This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
snackbar/main.go
2024-04-22 21:09:29 +02:00

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)
}
}