From c60d21dd534df35c955f83bffcc96a20177613cf Mon Sep 17 00:00:00 2001 From: Andrea Fazzi Date: Thu, 28 Oct 2021 09:28:12 +0200 Subject: [PATCH] Reindirizzamente sul nuovo sito --- .gitignore | 2 ++ go.mod | 3 +++ main.go | 21 ++++++++++++++++----- themes/ananke | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 go.mod diff --git a/.gitignore b/.gitignore index 0defb5c..b580ef9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ **/*~ +oef_website + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a00e97c --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.andreafazzi.eu/andrea/oef_website + +go 1.17 diff --git a/main.go b/main.go index 2eb8db3..1cf4061 100644 --- a/main.go +++ b/main.go @@ -5,10 +5,21 @@ import ( "net/http" ) -func main() { - fs := http.FileServer(http.Dir("public")) - http.Handle("/", fs) +func redirect(w http.ResponseWriter, r *http.Request) { - log.Println("Starting the web server for OEF...") - http.ListenAndServe(":3000", nil) + http.Redirect(w, r, "https://www.oief.it", 301) +} + +func main() { + // fs := http.FileServer(http.Dir("public")) + // http.Handle("/", fs) + + // log.Println("Starting the web server for OEF...") + // http.ListenAndServe(":3000", nil) + + http.HandleFunc("/", redirect) + err := http.ListenAndServe(":3000", nil) + if err != nil { + log.Fatal("ListenAndServe: ", err) + } } diff --git a/themes/ananke b/themes/ananke index cc963b3..813de5c 160000 --- a/themes/ananke +++ b/themes/ananke @@ -1 +1 @@ -Subproject commit cc963b323f5f798293fab69d24f7c83d9c3b9e75 +Subproject commit 813de5ccd6b1befd0d7efb7468402d3a7cb4913e