From c098c2f8d87204f05570f54a67d081b57dc803ee Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 9 Feb 2023 23:07:07 -0800 Subject: [PATCH] Chat API endpoint --- pkg/controller/chat/chat.go | 4 +++- web/templates/chat.html | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/pkg/controller/chat/chat.go b/pkg/controller/chat/chat.go index 51681e1..e60e6e9 100644 --- a/pkg/controller/chat/chat.go +++ b/pkg/controller/chat/chat.go @@ -80,7 +80,9 @@ func Landing() http.HandlerFunc { return } - var vars = map[string]interface{}{} + var vars = map[string]interface{}{ + "ChatAPI": strings.TrimSuffix(config.Current.BareRTC.URL, "/") + "/api/statistics", + } if err := tmpl.Execute(w, r, vars); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return diff --git a/web/templates/chat.html b/web/templates/chat.html index 5f26891..4d2b0a0 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -33,6 +33,12 @@ to watch yours, and you can open one or multiple videos broadcasted by the other chatters.

+ +

This chat room is currently ready for beta testing. It's a very new app built specifically for {{PrettyTitle}} and may still be lacking in some features and may be rough around @@ -88,4 +94,40 @@ + + {{end}} \ No newline at end of file