main.go 767 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package main
  2. import (
  3. "embed"
  4. "github.com/wailsapp/wails/v2"
  5. "github.com/wailsapp/wails/v2/pkg/options"
  6. "github.com/wailsapp/wails/v2/pkg/options/assetserver"
  7. )
  8. var (
  9. //go:embed all:frontend/dist
  10. assets embed.FS
  11. app *App
  12. )
  13. func main() {
  14. //
  15. go runHttpServe()
  16. // Create an instance of the app structure
  17. app = NewApp()
  18. // Create application with options
  19. err := wails.Run(&options.App{
  20. Title: "剑鱼-爬虫开发平台 v1.0",
  21. Width: 1224,
  22. Height: 668,
  23. AssetServer: &assetserver.Options{
  24. Assets: assets,
  25. },
  26. BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 1},
  27. OnStartup: app.startup,
  28. OnShutdown: app.destory,
  29. Bind: []interface{}{
  30. app,
  31. },
  32. })
  33. if err != nil {
  34. println("Error:", err.Error())
  35. }
  36. }