https://github.com/masamiyamate/katana-alexa-https-hosting
Move Alexa skill on VPS
https://github.com/masamiyamate/katana-alexa-https-hosting
alexa alexa-skill alexa-skills-kit
Last synced: 3 months ago
JSON representation
Move Alexa skill on VPS
- Host: GitHub
- URL: https://github.com/masamiyamate/katana-alexa-https-hosting
- Owner: MasamiYamate
- License: mit
- Created: 2019-01-21T06:31:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-04T05:58:47.000Z (over 6 years ago)
- Last Synced: 2025-07-01T20:01:46.755Z (3 months ago)
- Topics: alexa, alexa-skill, alexa-skills-kit
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# katana-alexa-https-hosting
Move Alexa skill on VPS## Description
This module is for running Alexa Skill in an environment not Lambda.## Installation
From npm```
npm install --save katana-alexa-https-hosting
```## How to use
**Please use a daemonization tool such as "forever" together.**### example
```sample.js
const KatanaHttps = require('katana-alexa-https-hosting')
const Alexa = require('ask-sdk')//Launch intent handler
const LaunchIntentHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request
return request.type === 'LaunchRequest'
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak('Wellcome!')
.withShouldEndSession(true)
.getResponse();
}
}//Error intent handler
const ErrorHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request
return request.type === 'LaunchRequest'
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak('Sorry, an error occurred.')
.withShouldEndSession(true)
.getResponse();
}
}//Generate skill builder.
//At this time, do not call "lambda ()" or "create ()".
var skillBuilder = Alexa.SkillBuilders.standard()
.addErrorHandlers(LaunchIntentHandler)
.addErrorHandlers(ErrorHandler)//When using DynamoDB, region setting of aws-sdk is necessary.
KatanaHttps.awsSetup.setRegion('ap-northeast-1')//Set the port number to be listened to.
//The default is 3000.
//KatanaHttps.expressSetup.setPortNo(3030)//Set the path requested by the skill.
//The default value is "/"
//KatanaHttps.expressSetup.setAnyPath('/alexa/')//I will set up the skill builder that I have created.
KatanaHttps.alexaSetup.setSkill(skillBuilder)//Start the skill.
KatanaHttps.expressSetup.start()
```