@@ -139,36 +139,35 @@ Options:
139
139
Keep in mind that the config file is not a true commonJS module, and
140
140
will be evaluated directly inside the browser in an immediately invoked
141
141
function expression.
142
+ ```
142
143
143
- The CLI host app also provides a proxy route under `/proxy/` that can be used
144
- if you need the client and host applications on the same domain. To use the proxy,
145
- simply make the url registered for the client that of the host app, followed by
146
- `/proxy/` and then the url of the client app. (See `app2` in the config below
147
- for an example)
144
+ The CLI host app also provides a proxy config file that can be used
145
+ if you need the client and host applications on the same domain. (See ` app2 ` in the config below
146
+ for an example).
148
147
149
- Here is an example config file:
148
+ ` ifc-cli- config.js `
150
149
150
+ ``` json
151
151
module.exports = function(frameRouter) {
152
152
frameRouter.clientConfig = {
153
153
clients: {
154
154
app1: {
155
- url: 'http://localhost:8080 /client-app-1/#/',
155
+ url: '/client-app-1/#/',
156
156
assignedRoute: '/app1'
157
157
},
158
158
app2: {
159
- // Instead of directly referencing client 2 via "url: `http://${hostname}:8080/client-app-2/#/`"
160
- // we use the built-in proxy route so it can share the same domain as the host app.
161
- url: `${window.location.origin}/proxy/${encodeURI(
162
- `http://${hostname}:8080/client-app-2/#/`
163
- )}`,
159
+ url: '/client-app-2/#/',
164
160
assignedRoute: '/app2',
165
161
sandbox: 'allow-presentation', // optional
166
162
allow: 'microphone http://localhost:8080;' // optional
167
163
}
168
164
},
169
165
envData: {
170
166
locale: 'en-US',
171
- hostRootUrl: window.location.origin,
167
+ hostRootUrl:
168
+ window.location.origin +
169
+ window.location.pathname +
170
+ window.location.search,
172
171
custom: getCustomClientData()
173
172
}
174
173
};
@@ -185,6 +184,25 @@ function getCustomClientData() {
185
184
}
186
185
```
187
186
187
+ ` ifc-proxy.config.json `
188
+
189
+ ``` json
190
+ {
191
+ "static" : {
192
+ // Instead of directly referencing client 2 via "url: `http://${hostname }:8080/client-app-2/#/`"
193
+ // we create a static directory for the second client.
194
+ "/client-app-2" : " http://${hostname}:8080"
195
+ },
196
+ // This file also has support for basic proxy configurations
197
+ "proxies" : {
198
+ "something" : {
199
+ path: "/something"
200
+ target: "http://www.example.org/something"
201
+ }
202
+ }
203
+ }
204
+ ```
205
+
188
206
### Development
189
207
190
208
#### Installation
0 commit comments