// $Id: recipe-index.go,v 1.3 2025/04/22 13:53:49 oc45ujef Exp $ package main import ( "encoding/xml" "fmt" "log" "net/http" "net/http/cgi" "os" "io/fs" ) type Recipe struct { Title string `xml:"title"` Icon struct { Href string `xml:"href,attr"` } `xml:"icon"` } func site(w http.ResponseWriter, r *http.Request) { files, err := fs.Glob(os.DirFS("."), "*.xml") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } fmt.Fprintln(w, ` Index of /~oc45ujef/recipes

Rezepte

`) } func main() { if err := cgi.Serve(http.HandlerFunc(site)); err != nil { log.Println(err) } }