You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 24, 2021. It is now read-only.
@@ -125,7 +107,7 @@ And finally, if you decide to use this technique you'll want to make sure you un
125
107
In some cases it is valuable to be able to control the __meteor_runtime_config__ variable that initializes Meteor at runtime.
126
108
127
109
#### Example
128
-
There are occasions when a single Meteor server would like to serve multiple cordova applications that have each have a unique `ROOT_URL`. But there are 2 problems:
110
+
There are occasions when a single Meteor server would like to serve multiple cordova applications that each have a unique `ROOT_URL`. But there are 2 problems:
129
111
1. The Meteor server can only be configured to serve a single `ROOT_URL`.
130
112
2. The `cordova` applications are build time configured with a specific `ROOT_URL`.
131
113
@@ -134,7 +116,6 @@ These 2 conditions break `autoupdate` for the cordova applications. `cordova-plu
134
116
To remedy this problem `webapp` has a hook for dynamically configuring `__meteor_runtime_config__` on the server.
135
117
136
118
#### Dynamic Runtime Configuration Hook
137
-
Register a callback when the meteor runtime configuration, `__meteor_runtime_config__` is being sent to the client.
`WebApp.addRuntimeConfigHook(handler)` has one argument:
159
-
160
-
**handler** - The `handler` is called on each request for the root page which has `__meteor_runtime_config__` defined in it. The handler takes a single options argument with the following properties:
161
-
162
-
-**arch** - _String_. the architecture being responded to. This can be one of `web.browser`, `web.browser.legacy` or `web.cordova`.
object with some extra properties. This argument can be used to get information
166
-
about the incoming request.
167
-
-**encodedCurrentConfig** - _String_. the current configuration object encoded as a string for inclusion in the root html.
168
-
-**updated** - _Boolean_. `true` if the config for this architecture been updated since last called, otherwise `false`. This flag can be leveraged to cache the decoding/encoding for each architecture.
169
-
170
-
If the handler returns a _falsy_ value the hook will not modify the runtime configuration.
171
-
172
-
If the handler returns a _String_ the hook will substitute the string for the encoded configuration string. **Warning:** the hook does not check the return value at all it is the responsibility of the caller to get the formatting correct using the helper functions.
`WebApp.addUpdatedConfigHook(handler)` has one argument:
197
-
198
-
**handler** - The `handler` is called on every change to an `arch` runtime configuration. The handler takes a single options argument with the following properties:
199
-
200
-
-**arch** - _String_. the architecture being responded to. This can be one of `web.browser`, `web.browser.legacy` or `web.cordova`.
201
-
-**manifest** - _Object_. the manifest object.
202
-
-**runtimeConfig** - _Object_. the new updated configuration object for this `arch`.
0 commit comments