Reindirizzamente sul nuovo sito

This commit is contained in:
Andrea Fazzi 2021-10-28 09:28:12 +02:00
parent f2ea5bd646
commit c60d21dd53
4 changed files with 22 additions and 6 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
**/*~ **/*~
oef_website

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module git.andreafazzi.eu/andrea/oef_website
go 1.17

21
main.go
View file

@ -5,10 +5,21 @@ import (
"net/http" "net/http"
) )
func main() { func redirect(w http.ResponseWriter, r *http.Request) {
fs := http.FileServer(http.Dir("public"))
http.Handle("/", fs)
log.Println("Starting the web server for OEF...") http.Redirect(w, r, "https://www.oief.it", 301)
http.ListenAndServe(":3000", nil) }
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)
}
} }

@ -1 +1 @@
Subproject commit cc963b323f5f798293fab69d24f7c83d9c3b9e75 Subproject commit 813de5ccd6b1befd0d7efb7468402d3a7cb4913e