Skip to content

Commit dbd310f

Browse files
mnapolipgrzesik
authored andcommitted
Switch to HTTP APIs by default for Node SQS example
1 parent 2873eca commit dbd310f

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

aws-node-sqs-worker/README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ To learn more:
2828

2929
### Deployment
3030

31-
This example is made to work with the Serverless Framework dashboard, which includes advanced features such as CI/CD, monitoring, metrics, etc.
32-
33-
In order to deploy with dashboard, you need to first login with:
31+
Install dependencies with:
3432

3533
```
36-
serverless login
34+
npm install
3735
```
3836

39-
and then perform deployment with:
37+
Then deploy:
4038

4139
```
4240
serverless deploy
@@ -68,14 +66,14 @@ resources: 17
6866
api keys:
6967
None
7068
endpoints:
71-
POST - https://xxxx.execute-api.us-east-1.amazonaws.com/dev/produce
69+
POST - https://xxxx.execute-api.us-east-1.amazonaws.com/produce
7270
functions:
7371
producer: aws-node-sqs-worker-dev-producer
7472
jobsWorker: aws-node-sqs-worker-dev-jobsWorker
7573
layers:
7674
None
7775
jobs:
78-
queueUrl: https://sqs.us-east-1.amazonaws.com/xxxxxx/aws-node-sqs-worker-dev-jobs
76+
queueUrl: https://sqs.us-east-1.amazonaws.com/xxxx/aws-node-sqs-worker-dev-jobs
7977
```
8078

8179

@@ -86,7 +84,7 @@ _Note_: In current form, after deployment, your API is public and can be invoked
8684
After successful deployment, you can now call the created API endpoint with `POST` request to invoke `producer` function:
8785

8886
```bash
89-
curl --request POST 'https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/produce' --header 'Content-Type: application/json' --data-raw '{"name": "John"}'
87+
curl --request POST 'https://xxxxxx.execute-api.us-east-1.amazonaws.com/produce' --header 'Content-Type: application/json' --data-raw '{"name": "John"}'
9088
```
9189

9290
In response, you should see output similar to:

aws-node-sqs-worker/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Serverless Framework Node SQS Producer-Consumer on AWS",
55
"author": "",
66
"license": "MIT",
7-
"dependencies": {
7+
"devDependencies": {
88
"serverless-lift": "^1.1.2"
99
}
1010
}

aws-node-sqs-worker/serverless.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
service: aws-node-sqs-worker
2-
32
frameworkVersion: '2'
43

5-
64
provider:
75
name: aws
86
runtime: nodejs12.x
97
lambdaHashingVersion: '20201221'
10-
stage: dev
118

129
constructs:
1310
jobs:
@@ -19,9 +16,9 @@ functions:
1916
producer:
2017
handler: handler.producer
2118
events:
22-
- http:
19+
- httpApi:
2320
method: post
24-
path: produce
21+
path: /produce
2522
environment:
2623
QUEUE_URL: ${construct:jobs.queueUrl}
2724

0 commit comments

Comments
 (0)