summaryrefslogtreecommitdiff
path: root/pages.go
diff options
context:
space:
mode:
Diffstat (limited to 'pages.go')
-rw-r--r--pages.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pages.go b/pages.go
index 40c2c21..886f1d6 100644
--- a/pages.go
+++ b/pages.go
@@ -1,6 +1,7 @@
package main
import (
+ "github.com/gorilla/mux"
"html/template"
"net/http"
"path"
@@ -11,7 +12,7 @@ var (
)
type ChatpageData struct {
- Websock string
+ Websock, Roomname string
}
func PrepTemplates() {
@@ -24,5 +25,6 @@ func Home(rw http.ResponseWriter, req *http.Request) {
}
func Chatpage(rw http.ResponseWriter, req *http.Request) {
- TplChat.Execute(rw, ChatpageData{"ws://" + req.Host + req.URL.Path + "socket"})
+ vars := mux.Vars(req)
+ TplChat.Execute(rw, ChatpageData{"ws://" + req.Host + req.URL.Path + "socket", vars["chatroom"]})
}