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
Copy file name to clipboardExpand all lines: playground/README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,3 +8,26 @@
8
8
This is a Custom Application used to help developing features in this repository.
9
9
10
10
Please read the [documentation](https://docs.commercetools.com/custom-applications) about Custom Applications before getting started.
11
+
12
+
## Using the Echo Server view
13
+
14
+
One of the example views showcases sending requests to a remote server. If you want to use that functionality, you will need to start a local server to echo the response back to the browser.
15
+
16
+
Since that view uses the `[proxy/forward-to](https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api)` MC endpoint and it only allows to forward requests to an external service through HTTPS protocol, we need to start that kind of service locally.
17
+
18
+
You can use a [secure local tunnel](https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#local-development-using-a-secure-tunnel) to help with this context. For instance, using **[ngrok](https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#ngrok)**.
19
+
The local server will listen in port `3003` by default (you can change it with the `PLAYGROUND_SERVER_PORT` environment variable). You will need to use it when starting the local tunnel.
20
+
21
+
When using the tunnel, you will need to configure some environment variables with the domain assigned.
22
+
Once you get the tunnel domain, head over the `.env.local` file (in the root directory) and make sure you use it in these variables:
23
+
24
+
```
25
+
PLAYGROUND_API_AUDIENCE="<tunnel_domain>"
26
+
ECHO_SERVER_URL="<tunnel_domain>/api/echo"
27
+
```
28
+
29
+
Once you did that, you also need to start the local server with this command:
0 commit comments