From cddf7ed45147869a9d2eee2e40f59a97c472ea72 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 26 Sep 2020 20:59:34 -0400 Subject: 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. --- cmd/server/main.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'cmd/server') 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()) } -- cgit v1.2.3