aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthinkpadmaster <a.scerba02@gmail.com>2023-07-21 22:55:47 -0500
committerAlex Scerba <alex@scerba.org>2024-10-29 13:19:57 -0400
commit2d82e28f17fcc613f15fcc7b1436cb923f2ac911 (patch)
tree3f53fa2e6223156361e587011a300b7bacce2ea7
parent5c088b1fd9c82aff92b64d76fc6a11753b356447 (diff)
Use new wwwRedirect
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index fc31f0e..a64a620 100644
--- a/main.go
+++ b/main.go
@@ -57,8 +57,10 @@ func main() {
mux.HandleFunc("/about/", app.about)
mux.HandleFunc("/", app.home)
+ www := app.wwwRedirect(mux)
+
infoLog.Println("Starting server...")
go http.ListenAndServe(":80", http.HandlerFunc(app.httpsRedirect))
- errorLog.Fatal(http.ListenAndServeTLS(":443", "/etc/letsencrypt/live/alexscerba.com/fullchain.pem", "/etc/letsencrypt/live/alexscerba.com/privkey.pem", mux))
+ errorLog.Fatal(http.ListenAndServeTLS(":443", "/etc/letsencrypt/live/alexscerba.com/fullchain.pem", "/etc/letsencrypt/live/alexscerba.com/privkey.pem", www))
//errorLog.Fatal(http.ListenAndServe(":4000", mux)) // for local dev because I'm lazy
}