Reindirizzamente sul nuovo sito
This commit is contained in:
parent
f2ea5bd646
commit
c60d21dd53
4 changed files with 22 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
**/*~
|
||||
oef_website
|
||||
|
||||
|
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module git.andreafazzi.eu/andrea/oef_website
|
||||
|
||||
go 1.17
|
21
main.go
21
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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit cc963b323f5f798293fab69d24f7c83d9c3b9e75
|
||||
Subproject commit 813de5ccd6b1befd0d7efb7468402d3a7cb4913e
|
Loading…
Reference in a new issue