Files
dmxconnect/main.go

56 lines
1.1 KiB
Go
Raw Normal View History

2023-08-25 20:33:11 +00:00
package main
import (
"embed"
2024-12-29 13:09:46 +01:00
"time"
2023-08-25 20:33:11 +00:00
2024-12-29 13:09:46 +01:00
"os"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
2023-08-25 20:33:11 +00:00
"github.com/wailsapp/wails/v2"
2024-12-29 13:09:46 +01:00
"github.com/wailsapp/wails/v2/pkg/logger"
2023-08-25 20:33:11 +00:00
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
2024-12-29 13:09:46 +01:00
// Configure the logger
log.Logger = log.Output(zerolog.ConsoleWriter{
Out: os.Stderr,
TimeFormat: "2006-01-02 15:04:05",
})
zerolog.TimestampFunc = func() time.Time {
return time.Now().Local()
}
zerolog.SetGlobalLevel(zerolog.TraceLevel)
2023-08-25 20:33:11 +00:00
// Create an instance of the app structure
app := NewApp()
// Create application with options
err := wails.Run(&options.App{
Title: "dmxconnect",
Width: 1024,
Height: 768,
WindowStartState: options.Maximised,
2023-08-25 20:33:11 +00:00
AssetServer: &assetserver.Options{
Assets: assets,
},
OnStartup: app.onStartup,
OnDomReady: app.onReady,
OnShutdown: app.onShutdown,
2023-08-25 20:33:11 +00:00
Bind: []interface{}{
app,
},
2024-12-29 13:09:46 +01:00
LogLevel: logger.ERROR,
2023-08-25 20:33:11 +00:00
})
if err != nil {
2024-12-29 13:09:46 +01:00
log.Err(err).Str("file", "main").Msg("unable to start the application")
2023-08-25 20:33:11 +00:00
}
2024-12-29 13:09:46 +01:00
}