diff options
author | Kevin Chabowski <kevin@kch42.de> | 2014-03-27 12:28:05 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2014-03-27 23:51:07 +0100 |
commit | dfd11c94c1ad5261caa43128a39fcce550edf61d (patch) | |
tree | b80458e610077b17da9815d14f71f590d4de56af /pages.go | |
parent | c35e43e9cf0f915236016a3f73a6ee6bc9962e0b (diff) | |
download | simplechat-dfd11c94c1ad5261caa43128a39fcce550edf61d.tar.gz simplechat-dfd11c94c1ad5261caa43128a39fcce550edf61d.tar.bz2 simplechat-dfd11c94c1ad5261caa43128a39fcce550edf61d.zip |
Chat now works on the client side
Diffstat (limited to 'pages.go')
-rw-r--r-- | pages.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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"]}) } |