Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Created August 11, 2017 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrelmiller/03891bc9fe6a662dc0db217d049c6a90 to your computer and use it in GitHub Desktop.
Save darrelmiller/03891bc9fe6a662dc0db217d049c6a90 to your computer and use it in GitHub Desktop.
API Management Policy to call darksky API
<policies>
<inbound>
<base/>
<rewrite-uri template="@{
var lat = 45.4272878;
var lng = -73.871513;
var time = "2017-04-03T19:00:00";
return $"forecast/{{forecast-key}}/{lat},{lng},{time}/?exclude=minutely,hourly,daily,flags,alerts&units=us";}"/>
<set-backend-service base-url="https://api.darksky.net/"/>
</inbound>
<backend>
<base/>
</backend>
<outbound>
<base/>
</outbound>
</policies>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment