0
owncast/webserver/handlers/customJavascript.go

17 lines
422 B
Go
Raw Normal View History

package handlers
import (
"net/http"
"github.com/owncast/owncast/persistence/configrepository"
)
// ServeCustomJavascript will serve optional custom Javascript.
func ServeCustomJavascript(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/javascript; charset=utf-8")
configRepository := configrepository.Get()
js := configRepository.GetCustomJavascript()
2023-01-18 22:45:16 -08:00
_, _ = w.Write([]byte(js))
}