diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2020-09-26 20:59:34 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2020-09-26 21:01:33 -0400 |
| commit | cddf7ed45147869a9d2eee2e40f59a97c472ea72 (patch) | |
| tree | 551e04c6018a46b4288d9ea2e7ee3ffb666c271b /cmd/server/main.go | |
| parent | 09979dcab01643349cee425b71fa3b4db24f8d60 (diff) | |
| download | go-website-cddf7ed45147869a9d2eee2e40f59a97c472ea72.tar.gz go-website-cddf7ed45147869a9d2eee2e40f59a97c472ea72.tar.xz | |
Split up http related stuff out of the page library.
Make it an interface.
Rename page to be 'local' reflecting that it reads the website off the local disk.
Update the build script to include the go version.
Switch to gorilla/mux
Remove the convert command, since we're no longer utilizing that old
layout or have any need to convert from it.
Diffstat (limited to 'cmd/server/main.go')
| -rw-r--r-- | cmd/server/main.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index c18aa55..f034cfa 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -6,8 +6,11 @@ import ( "log" "net/http" "os" + "time" - "git.riedstra.us/mitch/go-website/page" + siteHttp "git.riedstra.dev/mitch/go-website/http" + // "git.riedstra.dev/mitch/go-website/local" + // "git.riedstra.dev/mitch/go-website/page" ) var VersionString = "" @@ -32,6 +35,16 @@ func main() { log.Fatal(err) } - page.SetupHandlers() - _ = http.ListenAndServe(*listen, nil) + // We're going to utilize the local version of the website + // siteHttp.NewPage = func(u string) page.Page { + // return &local.Page{Path: u} + // } + + srv := &http.Server{ + Handler: siteHttp.GetHandler(), + Addr: *listen, + WriteTimeout: 15 * time.Second, + ReadTimeout: 15 * time.Second, + } + log.Fatal(srv.ListenAndServe()) } |
