Consolidate config files and surface frontend values via API. Closes #30

This commit is contained in:
Gabe Kangas
2020-06-28 15:10:00 -07:00
parent a9b8a70e8a
commit 73b6937496
6 changed files with 63 additions and 30 deletions

18
controllers/config.go Normal file
View File

@@ -0,0 +1,18 @@
package controllers
import (
"encoding/json"
"net/http"
"github.com/gabek/owncast/config"
"github.com/gabek/owncast/router/middleware"
)
//GetWebConfig gets the status of the server
func GetWebConfig(w http.ResponseWriter, r *http.Request) {
middleware.EnableCors(&w)
config := config.Config.InstanceDetails
json.NewEncoder(w).Encode(config)
}