Skip to content

Commit d6379cd

Browse files
committed
feat: Add legacy templates
1 parent 5b7d821 commit d6379cd

File tree

374 files changed

+23220
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+23220
-0
lines changed

legacy/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Legacy templates
2+
3+
The templates in this directory are used by `serverless create` command with `--template` flag (that will be replaced with `serverless`) and previously lived directly in `serverless/serverless` repository.
4+
5+
We still accept adjustments to existing templates, but we will not accept new templates supported by the `serverless create --template <template-name>` command directly.

legacy/aliyun-nodejs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# package directories
2+
node_modules
3+
jspm_packages
4+
5+
# Serverless directories
6+
.serverless

legacy/aliyun-nodejs/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
exports.hello = (event, context, callback) => {
4+
const response = {
5+
statusCode: 200,
6+
body: JSON.stringify({ message: 'Hello!' }),
7+
};
8+
9+
callback(null, response);
10+
};

legacy/aliyun-nodejs/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "aliyun-nodejs",
3+
"version": "1.0.0",
4+
"description": "Aliyun example using nodejs",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "alibabacloud.com",
10+
"license": "MIT",
11+
"devDependencies": {
12+
"serverless-aliyun-function-compute": "*"
13+
}
14+
}

legacy/aliyun-nodejs/serverless.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Welcome to Serverless!
2+
#
3+
# For full config options, check out the Alibaba Cloud Function Compute
4+
# plugin docs:
5+
# https://github.com/aliyun/serverless-aliyun-function-compute
6+
#
7+
# For documentation on Alibaba Cloud Function Compute itself:
8+
# https://serverless.aliyun.com
9+
10+
# Update the service name below with your own service name
11+
12+
service: aliyun-nodejs
13+
14+
frameworkVersion: '3'
15+
16+
provider:
17+
name: aliyun
18+
runtime: nodejs8
19+
credentials: ~/.aliyuncli/credentials # path must be absolute
20+
21+
plugins:
22+
- serverless-aliyun-function-compute
23+
24+
package:
25+
exclude:
26+
- package-lock.json
27+
- .gitignore
28+
- .git/**
29+
30+
functions:
31+
hello:
32+
handler: index.hello
33+
events:
34+
- http:
35+
path: /foo
36+
method: get
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# package directories
2+
node_modules
3+
jspm_packages
4+
5+
# Serverless directories
6+
.serverless
7+
8+
# Webpack directories
9+
.webpack
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Ask from 'ask-sdk';
2+
import 'source-map-support/register';
3+
4+
export const alexa = Ask.SkillBuilders.custom()
5+
.addRequestHandlers({
6+
canHandle: handlerInput => true,
7+
handle: handlerInput =>
8+
handlerInput.responseBuilder.speak('Hello world!').getResponse()
9+
})
10+
.lambda();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "aws-alexa-typescript",
3+
"version": "1.0.0",
4+
"description": "Alexa example using Typescript",
5+
"main": "handler.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"dependencies": {
10+
"ask-sdk": "^2.3.0",
11+
"source-map-support": "^0.5.10"
12+
},
13+
"devDependencies": {
14+
"@types/node": "^10.12.18",
15+
"serverless-alexa-skills": "^0.1.0",
16+
"serverless-webpack": "^5.2.0",
17+
"ts-loader": "^5.3.3",
18+
"typescript": "^3.2.4",
19+
"webpack": "^4.29.0"
20+
},
21+
"author": "The serverless webpack authors (https://github.com/elastic-coders/serverless-webpack)",
22+
"license": "MIT"
23+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
service: aws-alexa-typescript # NOTE: update this with your service name
2+
3+
# app and org for use with dashboard.serverless.com
4+
#app: your-app-name
5+
#org: your-org-name
6+
7+
frameworkVersion: '3'
8+
9+
plugins:
10+
- serverless-webpack
11+
- serverless-alexa-skills
12+
13+
provider:
14+
name: aws
15+
runtime: nodejs12.x
16+
17+
custom:
18+
alexa:
19+
# Step 1: Run `sls alexa auth` to authenticate
20+
# Step 2: Run `sls alexa create --name "Serverless Alexa Typescript" --locale en-GB --type custom` to create a new skill
21+
skills:
22+
# Step 3: Paste the skill id returned by the create command here:
23+
- id: amzn1.ask.skill.xxxx-xxxx-xxxx-xxxx-xxxx
24+
manifest:
25+
publishingInformation:
26+
locales:
27+
en-GB:
28+
name: Serverless Alexa Typescript
29+
apis:
30+
custom:
31+
endpoint:
32+
# Step 4: Do your first deploy of your Serverless stack
33+
# Step 5: Paste the ARN of your lambda here:
34+
uri: arn:aws:lambda:[region]:[account-id]:function:[function-name]
35+
# Step 6: Run `sls alexa update` to deploy the skill manifest
36+
# Step 7: Run `sls alexa build` to build the skill interaction model
37+
# Step 8: Enable the skill in the Alexa app to start testing.
38+
manifestVersion: '1.0'
39+
models:
40+
en-GB:
41+
interactionModel:
42+
languageModel:
43+
invocationName: serverless typescript
44+
intents:
45+
- name: HelloIntent
46+
samples:
47+
- 'hello'
48+
49+
functions:
50+
alexa:
51+
handler: handler.alexa
52+
events:
53+
- alexaSkill: ${self:custom.alexa.skills.0.id}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"sourceMap": true,
4+
"target": "es6",
5+
"lib": ["esnext"],
6+
"moduleResolution": "node"
7+
},
8+
"exclude": ["node_modules"]
9+
}

0 commit comments

Comments
 (0)