feat: replace Python server with Go binary

This commit is contained in:
James 2026-03-02 01:18:26 -05:00
parent 07767e1111
commit 68354cddf9
2 changed files with 28 additions and 0 deletions

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/johanj/vault1984-web
go 1.23.6

25
main.go Normal file
View File

@ -0,0 +1,25 @@
package main
import (
"embed"
"log"
"net/http"
"os"
)
//go:embed *.html *.svg *.css
var static embed.FS
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "8099"
}
http.Handle("/", http.FileServer(http.FS(static)))
log.Printf("vault1984-web starting on :%s", port)
if err := http.ListenAndServe(":"+port, nil); err != nil {
log.Fatal(err)
}
}