serverless-local-dev-server
Version:
Develop Alexa-Skill and HTTP functions in Serverless without deploying to AWS
25 lines (21 loc) • 520 B
JavaScript
const Endpoint = require('./Endpoint')
class AlexaSkillEndpoint extends Endpoint {
constructor (alexaSkillConfig, func) {
super(alexaSkillConfig, func)
this.name = func.name
this.method = 'POST'
this.path = `/alexa-skill/${this.name}`
}
getLambdaEvent (request) {
// Pass-through
return request.body
}
handleLambdaSuccess (response, result) {
response.send(result)
}
toString () {
return `Alexa-Skill: ${this.name}`
}
}
module.exports = AlexaSkillEndpoint