Initial commit, test website

This commit is contained in:
2026-04-29 21:02:57 +02:00
commit c0d0c0186c
3 changed files with 40 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
module 192.168.1.180/odonax/filehost-home
go 1.26.2
+25
View File
@@ -0,0 +1,25 @@
package main
import (
"html/template"
"log"
"net/http"
)
func main() {
tmpl, err := template.ParseFiles("templates/home.html")
if err != nil {
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")
log.Fatal(http.ListenAndServe(":8080", nil))
}
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Name }}</title>
</head>
<body>
<h1>{{ .Name }}</h1>
<p>{{ .Description }}</p>
</body>
</html>