Skip to content

Instantly share code, notes, and snippets.

@gspncr
Created October 4, 2022 08:31
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 gspncr/4b6afb35953c5e659feba3322a68154c to your computer and use it in GitHub Desktop.
Save gspncr/4b6afb35953c5e659feba3322a68154c to your computer and use it in GitHub Desktop.
geomatch
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