shithub: hugo

Download patch

ref: 2b412d4ac7fb143addf2bf5139de7ee903525b24
parent: 73ec09258b56c7f27548c2786f12fe98b15f87c5
author: Marcelo Glezer <[email protected]>
date: Fri Oct 17 09:32:16 EDT 2014

fixed server reporting Web Server is available at https://localhost:1313 when server always serve http

--- a/commands/server.go
+++ b/commands/server.go
@@ -110,8 +110,6 @@
 
 func serve(port int) {
 	jww.FEEDBACK.Println("Serving pages from " + helpers.AbsPathify(viper.GetString("PublishDir")))
-	jww.FEEDBACK.Printf("Web Server is available at %s\n", viper.GetString("BaseUrl"))
-	fmt.Println("Press ctrl+c to stop")
 
 	httpFs := &afero.HttpFs{SourceFs: hugofs.DestinationFS}
 	fileserver := http.FileServer(httpFs.Dir(helpers.AbsPathify(viper.GetString("PublishDir"))))
@@ -125,6 +123,10 @@
 	} else {
 		http.Handle(u.Path+"/", http.StripPrefix(u.Path+"/", fileserver))
 	}
+
+	u.Scheme = "http"
+	jww.FEEDBACK.Printf("Web Server is available at %s\n", u.String())
+	fmt.Println("Press ctrl+c to stop")
 
 	err = http.ListenAndServe(":"+strconv.Itoa(port), nil)
 	if err != nil {