vault1984-web/main.go

26 lines
375 B
Go

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)
}
}