diff options
author | Mathias Magnusson <mathias@magnusson.space> | 2025-08-25 14:55:07 +0200 |
---|---|---|
committer | Mathias Magnusson <mathias@magnusson.space> | 2025-08-25 14:58:26 +0200 |
commit | fb59ea2f57da2abf3c7bd76feddfaf10e109d2f4 (patch) | |
tree | a6d7dad7faf61fc50172ee5ac706497b07d7afd2 /main.go | |
parent | 5391b4a7b69c7fea5df6fa658c67ec683a94cea3 (diff) | |
download | traedgaardstomten-main.tar.gz |
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +package main + +import ( + "embed" + "io/fs" + "net/http" +) + +//go:embed public/* +var public embed.FS + +func must[T any](t T, err error) T { + if err != nil { + panic(err) + } + return t +} + +func main() { + http.Handle("/", http.FileServerFS(must(fs.Sub(public, "public")))) + http.ListenAndServe(":http", nil) +} |