Module

Amazon.Alexa.Handler

Package
purescript-alexa
Repository
twitchard/purescript-alexa

#makeHandler Source

makeHandler :: (Foreign -> Foreign -> (Aff Foreign)) -> Handler

Converts a curried function to produce an uncurried function of the form expected by AWS lambda.

myHandler :: ∀ e. Foreign → Foreign → Aff e Foreign
myHandler event context =
  pure <<< encode $ "Return this string"

handler = makeHandler myHandler

will produce the equivalent of

exports.handler = function (event, context, callback) {
  return callback(null, "Return this string")
}