diff pkg/config/config.go @ 3104:19fc84a98479

Added "published-config" field to configuration. It's a path to a published JSON file (after login) to give additional parameters to the client. Reached by GET /api/system/config Currently the field "osm-url" is used by the client to determine the URL of the OSM server for the background layer.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 25 Apr 2019 15:31:43 +0200
parents ae678f7cf938
children 6a44a89ffb51
line wrap: on
line diff
--- a/pkg/config/config.go	Thu Apr 25 13:11:41 2019 +0200
+++ b/pkg/config/config.go	Thu Apr 25 15:31:43 2019 +0200
@@ -106,6 +106,10 @@
 // If left empty the system default for temporary files is used.
 func TmpDir() string { return viper.GetString("tmp-dir") }
 
+// PublishedConfig is a name of a JSON file where extra configuration is stored
+// to be served to to the web client.
+func PublishedConfig() string { return viper.GetString("published-config") }
+
 var (
 	proxyKeyOnce       sync.Once
 	proxyKey           []byte
@@ -267,6 +271,8 @@
 		"Defaults to system temp directory.")
 
 	str("schema-dirs", ".", "Directories to find XSD schema files in (recursive).")
+
+	str("published-config", "", "path to a config file served to client.")
 }
 
 var (