aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 97d40a4720b4bb518ba68563d7346867bb651502 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}