Fix embeds not loading on prod builds. Closes #2186

This commit is contained in:
Gabe Kangas 2022-10-10 14:05:58 -07:00
parent 902f21b361
commit d94723bd3a
No known key found for this signature in database
GPG key ID: 9A56337728BC81EA
2 changed files with 0 additions and 43 deletions

View file

@ -1,31 +0,0 @@
package controllers
import (
"net/http"
"github.com/owncast/owncast/router/middleware"
)
// GetChatEmbedreadwrite gets the embed for readwrite chat.
func GetChatEmbedreadwrite(w http.ResponseWriter, r *http.Request) {
// Set our global HTTP headers
middleware.SetHeaders(w)
http.ServeFile(w, r, "webroot/index-standalone-chat-readwrite.html")
}
// GetChatEmbedreadonly gets the embed for readonly chat.
func GetChatEmbedreadonly(w http.ResponseWriter, r *http.Request) {
// Set our global HTTP headers
middleware.SetHeaders(w)
http.ServeFile(w, r, "webroot/index-standalone-chat-readonly.html")
}
// GetVideoEmbed gets the embed for video.
func GetVideoEmbed(w http.ResponseWriter, r *http.Request) {
// Set our global HTTP headers
middleware.SetHeaders(w)
http.ServeFile(w, r, "webroot/index-video-only.html")
}

View file

@ -58,18 +58,6 @@ func Start() error {
// web config api
http.HandleFunc("/api/config", controllers.GetWebConfig)
// pre v0.0.8 chat embed
http.HandleFunc("/embed/chat", controllers.GetChatEmbedreadonly)
// readonly chat embed
http.HandleFunc("/embed/chat/readonly", controllers.GetChatEmbedreadonly)
// readwrite chat embed
http.HandleFunc("/embed/chat/readwrite", controllers.GetChatEmbedreadwrite)
// video embed
http.HandleFunc("/embed/video", controllers.GetVideoEmbed)
// return the YP protocol data
http.HandleFunc("/api/yp", yp.GetYPResponse)