initial
commit
2cac29adb7
|
|
@ -0,0 +1,2 @@
|
||||||
|
**/*.sw*
|
||||||
|
/charades
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
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")
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue