Skip to content

Instantly share code, notes, and snippets.

@clarkbw
Last active March 16, 2016 01:18
Show Gist options
  • Save clarkbw/b7d6a162b8e3e78681a8 to your computer and use it in GitHub Desktop.
Save clarkbw/b7d6a162b8e3e78681a8 to your computer and use it in GitHub Desktop.
Google Time Zone API datasource for Strongloop Loopback
"google": {
"name": "google",
"debug": true,
"connector": "rest",
"operations": [
{
"template": {
"doc": "The Google Time Zone API",
"method": "GET",
"url": "https://maps.googleapis.com/maps/api/timezone/{format=json}",
"headers": {
"content-type": "application/json",
"accept": "application/json"
},
"query": {
"location": "{!lat},{!lng}",
"timestamp": "{!timestamp:number}",
"key": "{appKey:string}",
"language": "{language:string}"
},
"variables": {
"lat": {
"type": "number",
"format": "double",
"required": true,
"doc": "Latitude"
},
"lng": {
"type": "number",
"format": "double",
"required": true,
"doc": "Longitude"
},
"timestamp": {
"type": "number",
"required": true,
"doc": "Time as seconds since midnight, January 1, 1970 UTC to determine daylight savings"
}
}
},
"functions": {
"timezone": [
"lat",
"lng",
"timestamp"
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment