@@ -130,11 +130,12 @@ MercureBundle provides a more advanced configuration:
130
130
mercure :
131
131
hubs :
132
132
default :
133
- url : https://mercure-hub.example.com/.well-known/mercure
133
+ url : ' %env(string:MERCURE_URL)%'
134
+ public_url : ' %env(string:MERCURE_PUBLIC_URL)%'
134
135
jwt :
135
- secret : ' !ChangeThisMercureHubJWTSecretKey! '
136
- publish : ['foo ', 'https://example.com/foo ']
137
- subscribe : ['bar ', 'https://example.com/bar ']
136
+ secret : ' %env(string:MERCURE_JWT_SECRET)% '
137
+ publish : ['https://example.com/foo1 ', 'https://example.com/foo2 ']
138
+ subscribe : ['https://example.com/bar1 ', 'https://example.com/bar2 ']
138
139
algorithm : ' hmac.sha256'
139
140
provider : ' My\Provider'
140
141
factory : ' My\Factory'
@@ -147,19 +148,20 @@ MercureBundle provides a more advanced configuration:
147
148
<config >
148
149
<hub
149
150
name =" default"
150
- url =" https://mercure-hub.example.com/.well-known/mercure"
151
- >
151
+ url =" %env(string:MERCURE_URL)%"
152
+ public_url =" %env(string:MERCURE_PUBLIC_URL)%"
153
+ > <!-- public_url defaults to url -->
152
154
<jwt
153
- secret =" !ChangeThisMercureHubJWTSecretKey! "
155
+ secret =" %env(string:MERCURE_JWT_SECRET)% "
154
156
algorithm =" hmac.sha256"
155
157
provider =" My\Provider"
156
158
factory =" My\Factory"
157
159
value =" my.jwt"
158
160
>
159
- <publish >foo </publish >
160
- <publish >https://example.com/foo </publish >
161
- <subscribe >bar </subscribe >
162
- <subscribe >https://example.com/bar </subscribe >
161
+ <publish >https://example.com/foo1 </publish >
162
+ <publish >https://example.com/foo2 </publish >
163
+ <subscribe >https://example.com/bar1 </subscribe >
164
+ <subscribe >https://example.com/bar2 </subscribe >
163
165
</jwt >
164
166
</hub >
165
167
</config >
@@ -170,11 +172,12 @@ MercureBundle provides a more advanced configuration:
170
172
$container->loadFromExtension('mercure', [
171
173
'hubs' => [
172
174
'default' => [
173
- 'url' => 'https://mercure-hub.example.com/.well-known/mercure',
175
+ 'url' => '%env(string:MERCURE_URL)%',
176
+ 'public_url' => '%env(string:MERCURE_PUBLIC_URL)%',
174
177
'jwt' => [
175
- 'secret' => '!ChangeThisMercureHubJWTSecretKey! ',
176
- 'publish' => ['foo ', 'https://example.com/foo '],
177
- 'subscribe' => ['bar ', 'https://example.com/bar '],
178
+ 'secret' => '%env(string:MERCURE_JWT_SECRET)% ',
179
+ 'publish' => ['https://example.com/foo1 ', 'https://example.com/foo2 '],
180
+ 'subscribe' => ['https://example.com/bar1 ', 'https://example.com/bar2 '],
178
181
'algorithm' => 'hmac.sha256',
179
182
'provider' => 'My\Provider',
180
183
'factory' => 'My\Factory',
0 commit comments