twilio-runtime-utils
v0.2.1
Published
Simple utils for twilio runtime functions
Downloads
4
Readme
Twilio runtime utils
Simple utilities for twilio runtime functions.
Reference
r
Signature: (path: string, prefix: string = "vendor-") -> any
Simple replacement for node's standard require function that automatically uses twilio assets when run from twilio runtime otherwise defaults to require().
wrapRouteHandler
Signature: (routeHandler: AsyncFunction) -> TwilioFunction
Wraps an async function that takes an object as parameter Returns a function with signature (ctx: {}, event: {}, callback: Function) -> void that can be used as twilio runtime event handler.
addCorsHeaders
Signature: (response: Twilio.Response, origin: string) -> Twilio.Response
Simple function to add CORS headers for given origin and response.