This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
burgernotes-app/main.go

26 lines
576 B
Go
Raw Normal View History

2024-04-25 07:37:16 +01:00
package main
import (
"github.com/arzumify/webview_go-4.1"
2024-04-25 07:37:16 +01:00
"net/http"
2024-04-25 18:08:29 +01:00
"os"
"path/filepath"
2024-04-25 07:37:16 +01:00
)
func main() {
go func() {
2024-04-25 18:08:29 +01:00
exepath, _ := os.Executable()
path, _ := filepath.EvalSymlinks(exepath)
http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir(filepath.Dir(path) + "/website"))))
2024-04-25 07:37:16 +01:00
http.ListenAndServe("localhost:52064", nil)
}()
w := webview.New(false)
defer w.Destroy()
w.SetTitle("Burgernotes")
w.SetSize(800, 800, webview.HintNone)
w.Navigate("http://localhost:52064")
w.Run()
}