Created
October 20, 2015 03:22
-
-
Save avantassel/d303c9c0ec2ce69c9923 to your computer and use it in GitHub Desktop.
Google Geolocation Strongloop Datasource
This file contains hidden or 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
"geo": { | |
"name": "geo", | |
"connector": "rest", | |
"operations": [ | |
{ | |
"template": { | |
"method": "GET", | |
"url": "http://maps.googleapis.com/maps/api/geocode/{format=json}", | |
"headers": { | |
"accepts": "application/json", | |
"content-type": "application/json" | |
}, | |
"query": { | |
"address": "{street},{city},{zipcode}", | |
"sensor": "{sensor=false}" | |
}, | |
"responsePath": "$.results[0].geometry.location" | |
}, | |
"functions": { | |
"geocode": [ | |
"street", | |
"city", | |
"zipcode" | |
] | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's how to call it from a Strongloop model with a vow promise