@@ -10,14 +10,150 @@ The Edge Proxy can be configured using a json configuration file (named `config.
10
10
11
11
You can set the following configuration in ` config.json ` to control the behaviour of the Edge Proxy:
12
12
13
- - ** environment_key_pairs** : An array of environment key pair objects, e.g:
14
- ` "environment_key_pairs":[{"server_side_key":"your_server_side_key", "client_side_key":"your_client_side_environment_key"}] `
15
- - ** [ optional] api_poll_frequency(seconds)** : Control how often the Edge Proxy is going to ping the server for changes,
16
- e.g: ` "api_poll_frequency":10 `
17
- - ** [ optional] api_url** : If you are running a self hosted version of flagsmith you can set the self hosted url here for
18
- edge-proxy in order to connect to your server, e.g: ` "api_url":"https://self.hosted.flagsmith.domain/api/v1" `
19
-
20
- After setting up the above configuration the ` config.json ` is going to look something like this:
13
+ ### ` environment_key_pairs `
14
+
15
+ An array of environment key pair objects:
16
+
17
+ ``` json
18
+ "environment_key_pairs" : [{
19
+ "server_side_key" : " your_server_side_key" ,
20
+ "client_side_key" : " your_client_side_environment_key"
21
+ }]
22
+ ```
23
+
24
+ ### ` api_poll_frequency `
25
+
26
+ ::: note
27
+
28
+ This setting is optional.
29
+
30
+ :::
31
+
32
+ Control how often the Edge Proxy is going to ping the server for changes, in seconds:
33
+
34
+ ``` json
35
+ "api_poll_frequency" : 30
36
+ ```
37
+
38
+ Defaults to ` 10 ` .
39
+
40
+ ### ` api_poll_timeout `
41
+
42
+ ::: note
43
+
44
+ This setting is optional.
45
+
46
+ :::
47
+
48
+ Specify the request timeout when trying to retrieve new changes, in seconds:
49
+
50
+ ``` json
51
+ "api_poll_timeout" : 1
52
+ ```
53
+
54
+ Defaults to ` 5 ` .
55
+
56
+ ### ` api_url `
57
+
58
+ ::: note
59
+
60
+ This setting is optional.
61
+
62
+ :::
63
+
64
+ Set if you are running a self hosted version of Flagsmith:
65
+
66
+ ``` json
67
+ "api_url" : " https://my-flagsmith.domain.com/api/v1"
68
+ ```
69
+
70
+ If not set, defaults to Flagsmith's Edge API.
71
+
72
+ ### ` allow_origins `
73
+
74
+ ::: note
75
+
76
+ This setting is optional.
77
+
78
+ :::
79
+
80
+ Set a value for the ` Access-Control-Allow-Origin ` header.
81
+
82
+ ``` json
83
+ "allow_origins" : " https://my-flagsmith.domain.com"
84
+ ```
85
+
86
+ If not set, defaults to ` * ` .
87
+
88
+ ### ` endpoint_caches `
89
+
90
+ ::: note
91
+
92
+ This setting is optional.
93
+
94
+ :::
95
+
96
+ Enable a LRU cache per endpoint.
97
+
98
+ Optionally, specify the LRU cache size with ` cache_max_size ` (defaults to 128):
99
+
100
+ ``` json
101
+ "endpoint_caches" : {
102
+ "flags" : {
103
+ "use_cache" : false
104
+ },
105
+ "identities" : {
106
+ "use_cache" : true ,
107
+ "cache_max_size" : 1000 ,
108
+ }
109
+ }
110
+ ```
111
+
112
+ ### ` logging.log_level `
113
+
114
+ ::: note
115
+
116
+ This setting is optional.
117
+
118
+ :::
119
+
120
+ Choose a logging level from ` "CRITICAL" ` , ` "ERROR" ` , ` "WARNING" ` , ` "INFO" ` , ` "DEBUG" ` . Defaults to ` "INFO" ` .
121
+
122
+ ``` json
123
+ "logging" : {"log_level" : " DEBUG" }
124
+ ```
125
+
126
+ ### ` logging.log_format `
127
+
128
+ ::: note
129
+
130
+ This setting is optional.
131
+
132
+ :::
133
+
134
+ Choose a logging forman between ` "generic" ` and ` "json" ` . Defaults to ` "generic" ` .
135
+
136
+ ``` json
137
+ "logging" : {"log_format" : " json" }
138
+ ```
139
+
140
+ ### ` logging.log_event_field_name `
141
+
142
+ ::: note
143
+
144
+ This setting is optional.
145
+
146
+ :::
147
+
148
+ Set a name used for human-readable log entry field when logging events in JSON. Defaults to ` "message" ` .
149
+
150
+ ``` json
151
+ "logging" : {"log_event_field_name" : " event" }
152
+ ```
153
+
154
+ ### ` config.json ` example
155
+
156
+ Here's an example of a minimal working Edge Proxy configuration:
21
157
22
158
``` json
23
159
{
0 commit comments