From 9ddce13cf645cdc7a977197fffcada77c6058381 Mon Sep 17 00:00:00 2001 From: Gavin Gong Date: Mon, 28 May 2018 20:57:13 +0800 Subject: [PATCH] feat: open browser when start server (#2) --- server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.go b/server.go index 967ad7b..5093eef 100644 --- a/server.go +++ b/server.go @@ -10,6 +10,7 @@ import ( import ( "github.com/ihexxa/quickshare/server/apis" "github.com/ihexxa/quickshare/server/libs/cfg" + "github.com/skratchdot/open-golang/open" ) func main() { @@ -36,5 +37,9 @@ func main() { } log.Printf("quickshare starts @ %s:%d", config.HostName, config.Port) + err := open.Start(fmt.Sprintf("http://%s:%d", config.HostName, config.Port)) + if err != nil { + log.Println(err) + } log.Fatal(server.ListenAndServe()) }