landing site https://dotya.ml
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
homepage/main.go

33 lines
474 B

package main
import (
"embed"
"io/fs"
"log"
"net/http"
)
var version = "development"
//go:embed public/*
var embeddedPublic embed.FS
func main() {
root, err := fs.Sub(embeddedPublic, "public")
if err != nil {
log.Fatal(err)
}
fs := http.FileServer(http.FS(root))
http.Handle("/", fs)
log.Printf("app built from revision '%s'\n", version)
log.Print("Listening on :1314...")
err = http.ListenAndServe(":1314", nil)
if err != nil {
log.Fatal(err)
}
}