diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1674a62 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module phc.dm.unipi.it/aziis98/nuovo-sito-poisson + +go 1.13 diff --git a/main.go b/main.go new file mode 100644 index 0000000..0300322 --- /dev/null +++ b/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "log" + "net/http" +) + +func serveHome(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "./views/home.html") +} + +func main() { + + http.HandleFunc("/", serveHome) + + log.Println("Listening on :8000...") + err := http.ListenAndServe(":8000", nil) + if err != nil { + log.Fatal(err) + } +} diff --git a/views/home.html b/views/home.html new file mode 100644 index 0000000..241dd4c --- /dev/null +++ b/views/home.html @@ -0,0 +1,13 @@ + + +
+ + +