Skip to content

Commit

Permalink
Initial commit. General setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
boobo94 committed Jul 7, 2018
0 parents commit d733da6
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
# NPM dependencies

node_modules
package-lock.json
43 changes: 43 additions & 0 deletions README.md
@@ -0,0 +1,43 @@
# AWS Lambda in TypeScript

## Install the dependencies

```bash
npm install
```

## Run project

1. Open a console

```bash
npm ngrok
```

Copy the https link go to Alexa Console, under Endpoint section, select `HTTPS` and paste the link in `Default Region` input field. From the below dropdown choose `My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority`.
Every time when you run the ngrok, you need to update the endpoint url. [1](https://medium.com/@cnadeau_/allow-alexa-to-run-your-locally-hosted-skill-1786e3ca7a1b)

2. Open another console
```bash
npm start
```

## Developer tasks

Frequently used `npm script`s:

| Script name | Description |
|---------------|---------------------------------------------------------------------------------------------------------------------|
| `start` | Runs the service locally, so you can call your API endpoints on http://localhost. |
| `ngrok` | Runs the ngrok service locally, so you can use the https endpoint in Alexa skill: https://XXXXX.ngrok.io. |

|


## Resources

1. https://medium.com/@cnadeau_/allow-alexa-to-run-your-locally-hosted-skill-1786e3ca7a1b
2. https://github.com/balassy/aws-lambda-typescript
3. https://ask-sdk-for-nodejs.readthedocs.io/en/latest/Developing-Your-First-Skill.html
4. https://ngrok.com/
5. https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs
6 changes: 6 additions & 0 deletions nodemon.json
@@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node ./src/index.ts"
}
46 changes: 46 additions & 0 deletions package.json
@@ -0,0 +1,46 @@
{
"name": "alexa-skill-starter-pack-typescript",
"version": "1.0.0",
"description": "A sample to create AWS Lambda functions in TypeScript with Serverless.",
"main": "src/index.ts",
"scripts": {
"start": "nodemon",
"ngrok": "./scripts/ngrok http -bind-tls=true -host-header=rewrite 3000",
"clean": "rimraf .build"
},
"keywords": [
"aws",
"lambda",
"tslint",
"typescript"
],
"author": "Bogdan Alexandru Militaru",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/boobo94/alexa-skill-starter-pack-typescript.git"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.0",
"@types/body-parser": "^1.17.0",
"@types/express": "^4.16.0",
"@types/node": "^10.0.7",
"@types/request": "^2.0.8",
"@types/request-promise-native": "^1.0.10",
"aws-lambda-mock-context": "^3.1.1",
"aws-sdk": "^2.149.0",
"body-parser": "^1.18.3",
"express": "^4.16.3",
"nodemon": "^1.17.5",
"rimraf": "^2.6.2",
"source-map-support": "^0.5.0",
"ts-node": "^7.0.0",
"tslint": "^5.8.0",
"typescript": "^2.9.2"
},
"dependencies": {
"ask-sdk": "^2.0.7",
"ask-sdk-core": "^2.0.7",
"ask-sdk-model": "^1.3.1"
}
}
26 changes: 26 additions & 0 deletions tsconfig.json
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": [
"es6"
],
"moduleResolution": "node",
"rootDir": "./",
"sourceMap": true,
"allowJs": true,
// "noImplicitAny": true,
"noUnusedLocals": true,
"noImplicitThis": true,
"strictNullChecks": true,
"noImplicitReturns": true,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true,
"forceConsistentCasingInFileNames": true,
"strict": true
},
"exclude": [
"node_modules",
"coverage"
]
}

0 comments on commit d733da6

Please sign in to comment.