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 Apr 12, 2024. It is now read-only.
This PR exposes a REST endpoint for the Stock Ticker service so REST
clients could query the service for the latest price for a symbol.
Unlike with the WebSocket version only one response will be generated
for the request. Also as a minor improvement to the experience, now
a request made either through REST or WebSocket will be responded
immediately instead of after 30 seconds have passed.
Signed-off-by: Josh Kim <[email protected]>
time="2021-08-17T13:28:15-07:00" level=info msg="Service channel 'stock-ticker-service' is now bridged to a REST endpoint /rest/stock-ticker/{symbol} (GET)\n" fileName=server.go goroutine=44 package=server
83
+
time="2021-08-17T13:28:15-07:00" level=info msg="Starting Fabric broker at localhost:30080/ws" fileName=server.go goroutine=1 package=server
84
+
time="2021-08-17T13:28:15-07:00" level=info msg="Starting HTTP server at localhost:30080 with TLS" fileName=server.go goroutine=3 package=server
84
85
```
85
86
86
-
Open your browser and navigate to https://localhost:30080, accept the self-signed certificate warning and you'll be greeted with a 404!
87
-
This is an expected behavior, as the demo app does not serve anything at root `/`, but we will consider changing the default 404 screen to
88
-
something that looks more informational or more appealing at least.
87
+
Now, open your browser and navigate to https://localhost:30080/rest/stock-ticker/VMW (or
88
+
type`curl -k https://localhost:30080/rest/stock-ticker/VMW`in Terminal if you prefer CLI),
89
+
and accept the self-signed certificate warning. You will be served a page that shows the latest stock price
90
+
for VMware, Inc. Try and swap out `VMW` with another symbol of your choice to further test it out!
91
+
92
+
> NOTE: The sample service is using a loosely gated third party API which imposes
93
+
> a substantial limit on how many calls you can make per minute and per day inreturnfor making
94
+
> the service free to all.
95
+
96
+
> NOTE: If you navigate to the root at https://localhost:30080, you'll be greeted with a 404!
97
+
> This is an expected behavior, as the demo app does not serve anything at root `/`, but we will
98
+
> consider changing the default 404 screen to something that is informational or more appealing at least.
0 commit comments