From: William King Date: Mon, 16 Dec 2013 08:37:09 +0000 (-0800) Subject: If baseurl is set then print that on the command line, else leave as default of localhost X-Git-Tag: v0.10~74 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e5aa08ff0c6498933ba6d0a1e8de2190cd1dc766;p=brevno-suite%2Fhugo If baseurl is set then print that on the command line, else leave as default of localhost Conflicts: commands/server.go --- diff --git a/commands/server.go b/commands/server.go index 73f23609..b3d02642 100644 --- a/commands/server.go +++ b/commands/server.go @@ -70,7 +70,12 @@ func serve(port int) { fmt.Println("Serving pages from " + Config.GetAbsPath(Config.PublishDir)) } - fmt.Printf("Web server is available at %s\n", Config.BaseUrl) + if BaseUrl == "" { + fmt.Printf("Web Server is available at %s\n", Config.BaseUrl) + } else { + fmt.Printf("Web Server is available at http://localhost:%v\n", port) + } + fmt.Println("Press ctrl+c to stop") panic(http.ListenAndServe(":"+strconv.Itoa(port), http.FileServer(http.Dir(Config.GetAbsPath(Config.PublishDir))))) }