feat: replace Python server with Go binary
This commit is contained in:
parent
07767e1111
commit
68354cddf9
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue