From dc29c7e989f8761d902e8ffcbc19c131f893303a Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 21 Feb 2019 10:33:46 +0100 Subject: Config package --- server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server.go') diff --git a/server.go b/server.go index 3b5c732..ad32199 100644 --- a/server.go +++ b/server.go @@ -10,6 +10,7 @@ import ( "flag" "path" "syscall" + "./config" ) var tmpl *template.Template @@ -115,7 +116,7 @@ func handleGet( w http.ResponseWriter, r *http.Request, headOnly bool) { ListCols []Entry ListFiles []Entry } - tmpl.Execute(w, Collection{ "Title" , cols, files}) + tmpl.Execute(w, Collection{ filename, cols, files}) case stat.Mode().IsRegular(): if !headOnly { @@ -324,6 +325,8 @@ func main() { helpString := `This is the help` versionString := "0.0.0" + config.ReadConfig() + const ( defaultDir = "." usageDir = "the directory to serve" @@ -339,6 +342,8 @@ func main() { flag.Parse() + fmt.Println(config.Config.Port) + if dir == "" { dir = defaultDir } -- cgit v1.2.3