Reformatted go.mod to use correct indentation
This commit is contained in:
@@ -1,25 +1,25 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
tmpl, err := template.ParseFiles("templates/home.html")
|
tmpl, err := template.ParseFiles("templates/home.html")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Failed to load template:", err)
|
log.Fatal("Failed to load template:", err)
|
||||||
}
|
|
||||||
|
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
data := map[string]string {
|
|
||||||
"Name": "Filehost at home",
|
|
||||||
"Description": "This is where you'll own your files and share them freely.",
|
|
||||||
}
|
}
|
||||||
tmpl.Execute(w, data)
|
|
||||||
})
|
|
||||||
|
|
||||||
log.Println("Starting filehost on :8080")
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
data := map[string]string{
|
||||||
|
"Name": "Filehost at home",
|
||||||
|
"Description": "This is where you'll own your files and share them freely.",
|
||||||
|
}
|
||||||
|
tmpl.Execute(w, data)
|
||||||
|
})
|
||||||
|
|
||||||
|
log.Println("Starting filehost on :8080")
|
||||||
|
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user