From d9ad0c4dc3fddb7071cc28b259eb656c1e78f4a8 Mon Sep 17 00:00:00 2001 From: Mark Spicer Date: Mon, 14 Jun 2021 18:18:02 -0400 Subject: [PATCH] Added fully qualified URL. (#52) This commit adds a fully qualified URL to be able to Command+Click from a terminal like iTerm2 and have it open the browser. --- serve.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serve.go b/serve.go index df095ba678..7256dd5a0a 100644 --- a/serve.go +++ b/serve.go @@ -18,7 +18,7 @@ import ( ) var ( - host string + host string port int watch bool ) @@ -131,7 +131,7 @@ func serve(cmd *cobra.Command, args []string) { w.Header().Set("Content-Type", "text/html") writePreviewHTML(w, webp) }) - fmt.Printf("listening on tcp/%d\n", port) + fmt.Printf("listening at http://%s:%d\n", host, port) log.Fatal(http.ListenAndServe(fmt.Sprintf("%s:%d", host, port), nil)) }