Get website relative to executable
This commit is contained in:
parent
4753feeab9
commit
a4851fa6d3
BIN
burgernotes-app
BIN
burgernotes-app
Binary file not shown.
7
main.go
7
main.go
|
@ -3,11 +3,16 @@ package main
|
|||
import (
|
||||
"github.com/arzumify/webview_go-4.1"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main() {
|
||||
go func() {
|
||||
http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir("./website"))))
|
||||
exepath, _ := os.Executable()
|
||||
path, _ := filepath.EvalSymlinks(exepath)
|
||||
|
||||
http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir(filepath.Dir(path) + "/website"))))
|
||||
http.ListenAndServe("localhost:52064", nil)
|
||||
}()
|
||||
|
||||
|
|
Reference in New Issue