charades/main.go

33 lines
566 B
Go

package main
import (
"fmt"
"local/args"
"log"
"net/http"
)
//go:embed ./words.txt
var words string
func main() {
as := args.NewArgSet()
as.Append(args.INT, "p", "port to listen on", 8091)
if err := as.Parse(); err != nil {
panic(err)
}
log.Printf("args: %+v", as)
log.Printf("words: %d", len(words))
if err := http.ListenAndServe(fmt.Sprintf(":%d", as.GetInt("p")), server{args: as}); err != nil {
panic(err)
}
}
type server struct {
args *args.ArgSet
}
func (server server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
panic("nil")
}