mirror of
https://github.com/OliveTin/OliveTin
synced 2026-09-03 16:35:40 +00:00
feature: Customizable external rest address
This commit is contained in:
@@ -8,9 +8,10 @@ import (
|
||||
// for both of them.
|
||||
func StartServers(cfg *config.Config) {
|
||||
go startWebUIServer(cfg)
|
||||
go startRestAPIServer(cfg)
|
||||
|
||||
if cfg.UseSingleHTTPFrontend {
|
||||
StartSingleHTTPFrontend(cfg)
|
||||
go StartSingleHTTPFrontend(cfg)
|
||||
}
|
||||
|
||||
startRestAPIServer(cfg)
|
||||
}
|
||||
|
||||
@@ -44,16 +44,10 @@ func findWebuiDir() string {
|
||||
}
|
||||
|
||||
func generateWebUISettings(w http.ResponseWriter, r *http.Request) {
|
||||
restAddress := ""
|
||||
|
||||
if !cfg.UseSingleHTTPFrontend {
|
||||
restAddress = cfg.ExternalRestAddress
|
||||
}
|
||||
|
||||
jsonRet, _ := json.Marshal(webUISettings{
|
||||
Rest: restAddress + "/api/",
|
||||
Rest: cfg.ExternalRestAddress + "/api/",
|
||||
ThemeName: cfg.ThemeName,
|
||||
ShowFooter: cfg.ShowFooter,
|
||||
ShowFooter: cfg.ShowFooter,
|
||||
ShowNavigation: cfg.ShowNavigation,
|
||||
ShowNewVersions: cfg.ShowNewVersions,
|
||||
AvailableVersion: updatecheck.AvailableVersion,
|
||||
|
||||
Reference in New Issue
Block a user