owncast/webserver/handlers/customJavascript.go
Gabe Kangas 0b5d7c8a4d
Config repository (#3988)
* WIP

* fix(test): fix ap test failing

* fix: fix unkeyed fields being used

* chore(tests): clean up browser tests by splitting out federation UI tests
2024-11-15 19:20:58 -08:00

16 lines
422 B
Go

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()
_, _ = w.Write([]byte(js))
}