Skip to content

Commit

Permalink
Added fully qualified URL. (#52)
Browse files Browse the repository at this point in the history
This commit adds a fully qualified URL to be able to Command+Click from
a terminal like iTerm2 and have it open the browser.
  • Loading branch information
betterengineering authored Jun 14, 2021
1 parent 157874c commit d9ad0c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var (
host string
host string
port int
watch bool
)
Expand Down Expand Up @@ -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))
}

Expand Down

0 comments on commit d9ad0c4

Please sign in to comment.