Commit 3c2316a8 authored by Boris Mühmer's avatar Boris Mühmer
Browse files

quick hack to open browser

parent c7753bdc
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ import (
	"fmt"
	"log"
	"net/http"

	"github.com/pkg/browser"
)

func main() {
@@ -14,8 +16,12 @@ func main() {
	http.HandleFunc("/", handlerIndex)

	// http://localhost:8080/s/test.html
	sp := "/s/"
	fs := http.FileServer(http.Dir("static"))
	http.Handle("/s/", http.StripPrefix("/s/", fs))
	http.Handle(sp, http.StripPrefix(sp, fs))

	// open browser... works... but it should be run after ListenAndServe
	browser.OpenURL("http://" + srv + "/s/test.html")

	err := http.ListenAndServe(srv, nil)
	if err != nil {