From fb59ea2f57da2abf3c7bd76feddfaf10e109d2f4 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Mon, 25 Aug 2025 14:55:07 +0200 Subject: Begin implementing go server --- main.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 main.go (limited to 'main.go') diff --git a/main.go b/main.go new file mode 100644 index 0000000..97d40a4 --- /dev/null +++ b/main.go @@ -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) +} -- cgit v1.2.3