forked from apigee/api-platform-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated sample to use weather API and WOEIDs
- Loading branch information
Showing
9 changed files
with
28 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
19 changes: 13 additions & 6 deletions
19
sample-proxies/target-reroute/apiproxy/policies/ExtractId.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
<ExtractVariables async="false" continueOnError="false" enabled="true" name="ExtractId"> | ||
<DisplayName>getObjectNumberfromPath</DisplayName> | ||
<!-- A WOEID (Where on Earth Identifier) is a unique 32 bit reference identifier assigned by Yahoo! to identify any feature on Earth. --> | ||
|
||
<ExtractVariables name="extractId"> | ||
<DisplayName>getWOEIDNumberfromPath</DisplayName> | ||
<!-- Pull the WEOID from the request path and populate a variable called 'location'. | ||
The prefix WOEID is defined below, to create the variable WOEID.location. | ||
--> | ||
<URIPath> | ||
<Pattern ignoreCase="true">/objects/{uri}</Pattern> | ||
<Pattern ignoreCase="true">/{location}</Pattern> | ||
</URIPath> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<VariablePrefix>path</VariablePrefix> | ||
</ExtractVariables> | ||
<!-- Continue processing without an error if the WOEID variable cannot be resolved (a bad request for example). --> | ||
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> | ||
<!-- The prefix for the variable name that will be referenced by the JavaScript. --> | ||
<VariablePrefix>WOEID</VariablePrefix> | ||
</ExtractVariables> |
3 changes: 3 additions & 0 deletions
3
sample-proxies/target-reroute/apiproxy/policies/rewriteTargetUrl.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<Javascript name="rewriteTargetUrl"> | ||
<ResourceURL>jsc://rewriteTargetUrl.js</ResourceURL> | ||
</Javascript> |
3 changes: 0 additions & 3 deletions
3
sample-proxies/target-reroute/apiproxy/policies/setJsHeader.xml
This file was deleted.
Oops, something went wrong.
18 changes: 6 additions & 12 deletions
18
sample-proxies/target-reroute/apiproxy/proxies/default.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<ProxyEndpoint name="default"> | ||
<Description></Description> | ||
<FaultRules/> | ||
<Flows/> | ||
<PreFlow name="PreFlow"> | ||
<Request> | ||
<Step> | ||
<FaultRules/> | ||
<Name>ExtractId</Name> | ||
</Step> | ||
</Request> | ||
<!-- During the request flow, extract the WEOID that was presented in the request. --> | ||
<Request><Step><Name>extractId</Name></Step></Request> | ||
</PreFlow> | ||
<HTTPProxyConnection> | ||
<BasePath>/yahoo</BasePath> | ||
<Properties/> | ||
<!-- All requests sent to '{org-name}-test.apigee.net/WEOID' will be handled by this API proxy. --> | ||
<BasePath>/WOEID</BasePath> | ||
<!-- Use the default virtual host configuration to set the network address for this proxy: '{org-name}-test.apigee.net --> | ||
<VirtualHost>default</VirtualHost> | ||
</HTTPProxyConnection> | ||
<RouteRule name="YahooRoute"> | ||
<!-- Forward requests to the TargetEndpoint configuration named 'default'. --> | ||
<TargetEndpoint>default</TargetEndpoint> | ||
</RouteRule> | ||
</ProxyEndpoint> |
2 changes: 1 addition & 1 deletion
2
...eroute/apiproxy/resources/jsc/setJsHeader → ...piproxy/resources/jsc/rewriteTargetUrl.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<APIProxy revision="21" name="rewriteTargetUrl"> | ||
</APIProxy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters