diff options
Diffstat (limited to 'cmd/server')
| -rw-r--r-- | cmd/server/main.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index c900234..9ec96da 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -8,8 +8,7 @@ import ( "os" "time" - siteHttp "riedstra.dev/mitch/go-website/http" - "riedstra.dev/mitch/go-website/local" + "riedstra.dev/mitch/go-website/page" ) var VersionString = "" @@ -24,9 +23,9 @@ func main() { listen := fl.String("l", "0.0.0.0:8001", "Listening address") directory := fl.String("d", ".", "Directory to serve.") version := fl.Bool("v", false, "Print the version then exit") - fl.StringVar(&local.TimeFormat, "T", local.TimeFormat, "Print the version then exit") - fl.StringVar(&siteHttp.ReindexRedirectTo, "r", - siteHttp.ReindexRedirectTo, "Page to redirect to after reindex") + fl.StringVar(&page.TimeFormat, "T", page.TimeFormat, "Print the version then exit") + indexPath := fl.String("i", "/reIndex", + "Path in which, when called will rebuild the index and clear the cache") _ = fl.Parse(os.Args[1:]) if *version { @@ -37,8 +36,13 @@ func main() { log.Fatal(err) } + app := &App{ + ReIndexPath: *indexPath, + StaticDirectory: "static", + } + srv := &http.Server{ - Handler: siteHttp.GetHandler(), + Handler: app, Addr: *listen, WriteTimeout: 15 * time.Second, ReadTimeout: 15 * time.Second, |
