Initial commit - skeleton

This commit is contained in:
Piv
2023-08-01 20:58:45 +09:30
commit 54257d1a60
7 changed files with 145 additions and 0 deletions

25
main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"embed"
_ "embed"
"flag"
"fmt"
"log"
"net/http"
)
//go:embed node_modules/@picocss/pico/css/pico.min.css index.html
var static embed.FS
func main() {
var port int
flag.IntVar(&port, "port", 8080, "Port to listen on")
flag.Parse()
http.Handle("/", http.FileServer(http.FS(static)))
log.Printf("Starting webserver on port %v", port)
http.ListenAndServe(fmt.Sprintf(":%v", port), nil)
}