summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.go b/main.go
index c18959a..b546da4 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,8 @@ package main
import (
"flag"
"github.com/gorilla/mux"
+ "log"
+ "math"
"net/http"
)
@@ -10,11 +12,18 @@ var (
laddr = flag.String("laddr", ":8080", "Listen on this address")
tplpath = flag.String("tplpath", "tpls", "Path to templates")
staticpath = flag.String("staticpath", "static", "Path to static page elements")
+ perroom = flag.Int("perroom", -1, "Maximum amount of users per room (negative for unlimited)")
)
func main() {
flag.Parse()
+ if *perroom < 0 {
+ *perroom = math.MaxInt32
+ } else if *perroom == 0 {
+ log.Fatalln("flag perroom must not be 0")
+ }
+
r := mux.NewRouter()
r.HandleFunc("/", Home)
r.PathPrefix("/static").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(*staticpath))))