diff options
author | ache <ache@ache.one> | 2019-02-21 10:33:46 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-02-21 10:33:46 +0100 |
commit | dc29c7e989f8761d902e8ffcbc19c131f893303a (patch) | |
tree | 351d5385227cdadcdfc59315a9649122db27a36d /server.go | |
parent | Size normalisation (diff) |
Config package
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 } |