Created
October 4, 2022 08:31
-
-
Save gspncr/4b6afb35953c5e659feba3322a68154c to your computer and use it in GitHub Desktop.
geomatch
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
exports.handler = async (context, event, callback) => { | |
// Providing a string will result in a 200 OK | |
var location = event.location.toLowerCase(); | |
console.log('hello'); | |
const TWILIO_SYNC_SERVICE_SID = 'ISxxx' | |
const TWILIO_MAP_SID = 'MPxxx' | |
const syncClient = Runtime.getSync({ serviceName: TWILIO_SYNC_SERVICE_SID}); | |
var enteredLocation = await syncClient | |
.syncMaps(TWILIO_MAP_SID) | |
.syncMapItems(location) | |
.fetch(); | |
return callback(null, enteredLocation.data.hub); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment