initial
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
**/*.sw*
|
||||||
|
/charades
|
||||||
32
main.go
Normal file
32
main.go
Normal file
@@ -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")
|
||||||
|
}
|
||||||
1
words/randomlists.com.json
Executable file
1
words/randomlists.com.json
Executable file
File diff suppressed because one or more lines are too long
1
words/textfixer.com.json
Normal file
1
words/textfixer.com.json
Normal file
File diff suppressed because one or more lines are too long
1
words/wordcounter.net.json
Normal file
1
words/wordcounter.net.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user