Skip to content

Commit 8bf8103

Browse files
authored
fix: lodash dependency for twilio example
1 parent c3bb1ef commit 8bf8103

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

aws-node-twilio-send-text-message/README.md

+31-21
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,37 @@ This example demonstrates how to send SMS messages with the Twilio SDK and AWS l
3030

3131
4. Set your `env` variables in `serverless.yml` with your Twilio account values
3232

33-
```yml
34-
environment:
35-
# replace these env variables with your twilio account values
36-
TWILIO_ACCOUNT_SID: YOUR-TWILIO-ACCOUNT-SID-HERE
37-
TWILIO_AUTH_TOKEN: YOUR-TWILIO-AUTH-TOKEN-HERE
38-
TWILIO_PHONE_NUMBER: YOUR-TWILIO-PHONE-NUMBER-HERE
39-
```
40-
41-
If you want to use encrypted API keys, see our [encrypted environment variables example](https://github.com/serverless/examples/tree/master/aws-node-env-variables-encrypted-in-a-file)
42-
43-
5. Invoke the function and send an SMS message
44-
45-
Update the `to` phone number the `event.json` file and `message` to send in the SMS
46-
47-
Then invoke the function with the serverless CLI. Set the `--path event.json` so the function knows where to send the SMS.
48-
49-
```bash
50-
serverless invoke -f sendText --path event.json
51-
```
52-
53-
6. (Optional) Deploy the front-end application
33+
```yml
34+
environment:
35+
# replace these env variables with your twilio account values
36+
TWILIO_ACCOUNT_SID: YOUR-TWILIO-ACCOUNT-SID-HERE
37+
TWILIO_AUTH_TOKEN: YOUR-TWILIO-AUTH-TOKEN-HERE
38+
TWILIO_PHONE_NUMBER: YOUR-TWILIO-PHONE-NUMBER-HERE
39+
```
40+
41+
If you want to use encrypted API keys, see our [encrypted environment variables example](https://github.com/serverless/examples/tree/master/aws-node-env-variables-encrypted-in-a-file)
42+
43+
5. Install the dependencies required by the service
44+
```bash
45+
npm i --only=prod
46+
```
47+
48+
6. Deploy the service
49+
```bash
50+
serverless deploy
51+
```
52+
53+
7. Invoke the function and send an SMS message
54+
55+
Update the `to` phone number the `event.json` file and `message` to send in the SMS
56+
57+
Then invoke the function with the serverless CLI. Set the `--path event.json` so the function knows where to send the SMS.
58+
59+
```bash
60+
serverless invoke -f sendText --path event.json
61+
```
62+
63+
8. (Optional) Deploy the front-end application
5464

5565
Update the `API_ENDPOINT` variable in the `/frontend/index.html` file and deploy the `/frontend` folder to a static host of your choice.
5666

aws-node-twilio-send-text-message/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"author": "David Wells",
1010
"license": "MIT",
1111
"dependencies": {
12-
"twilio": "^2.11.1"
12+
"twilio": "^3.65.0"
1313
},
1414
"devDependencies": {
1515
"chai": "^4.0.0",
16-
"mocha": "^3.4.2",
16+
"mocha": "^9.0.2",
1717
"sinon": "^2.3.2"
1818
}
1919
}

aws-node-twilio-send-text-message/serverless.yml

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ provider:
1212
package:
1313
exclude:
1414
- "*.test.js"
15-
- 'node_modules/**'
16-
- '!node_modules/twilio/**'
1715
- 'frontend/**'
1816

1917
functions:

0 commit comments

Comments
 (0)