You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This template demonstrates how to develop and deploy a simple Node Express API service running on AWS Lambda using the Serverless Framework.
17
17
18
-
This template configures a single function, `api`, which is responsible for handling all incoming requests using the `httpApi` event. To learn more about `httpApi` event configuration options, please refer to [httpApi event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/). As the event is configured in a way to accept all incoming requests, the Express.js framework is responsible for routing and handling requests internally. This implementation uses the `serverless-http` package to transform the incoming event request payloads to payloads compatible with Express.js. To learn more about `serverless-http`, please refer to corresponding [GitHub repository](https://github.com/dougmoscrop/serverless-http).
18
+
This template configures a single function, `api`, which is responsible for handling all incoming requests using the `httpApi` event. To learn more about `httpApi` event configuration options, please refer to [httpApi event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/). As the event is configured in a way to accept all incoming requests, the Express.js framework is responsible for routing and handling requests internally. This implementation uses the `serverless-http` package to transform the incoming event request payloads to payloads compatible with Express.js. To learn more about `serverless-http`, please refer to the [serverless-http README](https://github.com/dougmoscrop/serverless-http).
19
19
20
20
## Usage
21
21
@@ -40,7 +40,7 @@ Deploying "aws-node-express-api" to stage "dev" (us-east-1)
40
40
41
41
✔ Service deployed to stack aws-node-express-api-dev (96s)
42
42
43
-
endpoint: ANY - https://al7bkh7f57.execute-api.us-east-1.amazonaws.com
43
+
endpoint: ANY - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com
44
44
functions:
45
45
api: aws-node-express-api-dev-api (2.3 kB)
46
46
```
@@ -61,18 +61,6 @@ Which should result in the following response:
The easiest way to develop and test your function is to use the `dev` command:
@@ -83,14 +71,6 @@ serverless dev
83
71
84
72
This will start a local emulator of AWS Lambda and tunnel your requests to and from AWS Lambda, allowing you to interact with your function as if it were running in the cloud.
85
73
86
-
In another terminal you can invoke your function by using the following command:
Now you can invoke the function as before, but this time the function will be executed locally. Now you can develop your function locally, invoke it, and see the results immediately without having to re-deploy.
91
75
92
-
Which should result in response similar to the following:
93
-
94
-
```json
95
-
{ "message": "Hello from path!" }
96
-
```
76
+
When you are done developing, don't forget to run `serverless deploy` to deploy the function to the cloud.
Copy file name to clipboardExpand all lines: aws-node-express-dynamodb-api/README.md
+5-13
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Serverless Framework Node Express API service backed by DynamoDB on AWS'
3
3
description: 'This template demonstrates how to develop and deploy a simple Node Express API service backed by DynamoDB running on AWS Lambda using the Serverless Framework.'
This template demonstrates how to develop and deploy a simple Node Express API service, backed by DynamoDB table, running on AWS Lambda using the Serverless Framework.
17
17
18
-
This template configures a single function, `api`, which is responsible for handling all incoming requests using the `httpApi` event. To learn more about `httpApi` event configuration options, please refer to [httpApi event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/). As the event is configured in a way to accept all incoming requests, the Express.js framework is responsible for routing and handling requests internally. This implementation uses the `serverless-http` package to transform the incoming event request payloads to payloads compatible with Express.js. To learn more about `serverless-http`, please refer to corresponding [GitHub repository](https://github.com/dougmoscrop/serverless-http).
18
+
This template configures a single function, `api`, which is responsible for handling all incoming requests using the `httpApi` event. To learn more about `httpApi` event configuration options, please refer to [httpApi event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/). As the event is configured in a way to accept all incoming requests, the Express.js framework is responsible for routing and handling requests internally. This implementation uses the `serverless-http` package to transform the incoming event request payloads to payloads compatible with Express.js. To learn more about `serverless-http`, please refer to the [serverless-http README](https://github.com/dougmoscrop/serverless-http).
19
19
20
20
Additionally, it also handles provisioning of a DynamoDB database that is used for storing data about users. The Express.js application exposes two endpoints, `POST /users` and `GET /user/:userId`, which create and retrieve a user record.
21
21
@@ -42,7 +42,7 @@ Deploying "aws-node-express-dynamodb-api" to stage "dev" (us-east-1)
42
42
43
43
✔ Service deployed to stack aws-node-express-dynamodb-api-dev (109s)
44
44
45
-
endpoint: ANY - https://jhssgx6g93.execute-api.us-east-1.amazonaws.com
45
+
endpoint: ANY - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com
This will start a local emulator of AWS Lambda and tunnel your requests to and from AWS Lambda, allowing you to interact with your function as if it were running in the cloud.
87
87
88
-
In another terminal you can invoke your function by using the following command:
88
+
Now you can invoke the function as before, but this time the function will be executed locally. Now you can develop your function locally, invoke it, and see the results immediately without having to re-deploy.
Copy file name to clipboardExpand all lines: aws-node-http-api/README.md
+3-11
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Deploying "serverless-http-api" to stage "dev" (us-east-1)
33
33
34
34
✔ Service deployed to stack serverless-http-api-dev (91s)
35
35
36
-
endpoint: GET - https://xiz94rsg9g.execute-api.us-east-1.amazonaws.com/
36
+
endpoint: GET - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/
37
37
functions:
38
38
hello: serverless-http-api-dev-hello (1.6 kB)
39
39
```
@@ -64,14 +64,6 @@ serverless dev
64
64
65
65
This will start a local emulator of AWS Lambda and tunnel your requests to and from AWS Lambda, allowing you to interact with your function as if it were running in the cloud.
66
66
67
-
In another terminal you can invoke your function by using the following command:
67
+
Now you can invoke the function as before, but this time the function will be executed locally. Now you can develop your function locally, invoke it, and see the results immediately without having to re-deploy.
Copy file name to clipboardExpand all lines: aws-node-scheduled-cron/README.md
+2-4
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,6 @@ serverless dev
51
51
52
52
This will start a local emulator of AWS Lambda and tunnel your requests to and from AWS Lambda, allowing you to interact with your function as if it were running in the cloud.
53
53
54
-
This function will be called every minute by the scheduler; however, you can also manually invoke the function using this command:
54
+
Now you can invoke the function as before, but this time the function will be executed locally. Now you can develop your function locally, invoke it, and see the results immediately without having to re-deploy.
55
55
56
-
```
57
-
serverless invoke --function rateHandler
58
-
```
56
+
When you are done developing, don't forget to run `serverless deploy` to deploy the function to the cloud.
Copy file name to clipboardExpand all lines: aws-node/README.md
+2-13
Original file line number
Diff line number
Diff line change
@@ -63,17 +63,6 @@ serverless dev
63
63
64
64
This will start a local emulator of AWS Lambda and tunnel your requests to and from AWS Lambda, allowing you to interact with your function as if it were running in the cloud.
65
65
66
-
In another terminal you can invoke your function by using the following command:
66
+
Now you can invoke the function as before, but this time the function will be executed locally. Now you can develop your function locally, invoke it, and see the results immediately without having to re-deploy.
67
67
68
-
```
69
-
serverless invoke --function hello
70
-
```
71
-
72
-
Which should result in response similar to the following:
73
-
74
-
```json
75
-
{
76
-
"statusCode": 200,
77
-
"body": "{\"message\":\"Go Serverless v4.0! Your function executed successfully!\"}"
78
-
}
79
-
```
68
+
When you are done developing, don't forget to run `serverless deploy` to deploy the function to the cloud.
This template demonstrates how to develop and deploy a simple Python Flask API service running on AWS Lambda using the Serverless Framework.
17
17
18
-
## Anatomy of the template
19
-
20
-
This template configures a single function, `api`, which is responsible for handling all incoming requests thanks to configured `http` events. To learn more about `http` event configuration options, please refer to [http event docs](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/). As the events are configured in a way to accept all incoming requests, `Flask` framework is responsible for routing and handling requests internally. The implementation takes advantage of `serverless-wsgi`, which allows you to wrap WSGI applications such as Flask apps. To learn more about `serverless-wsgi`, please refer to corresponding [GitHub repository](https://github.com/logandk/serverless-wsgi). Additionally, the template relies on `serverless-python-requirements` plugin for packaging dependencies from `requirements.txt` file. For more details about `serverless-python-requirements` configuration, please refer to corresponding [GitHub repository](https://github.com/UnitedIncome/serverless-python-requirements).
18
+
This template configures a single function, `api`, which is responsible for handling all incoming requests thanks to configured `http` events. To learn more about `http` event configuration options, please refer to [http event docs](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/). As the events are configured in a way to accept all incoming requests, `Flask` framework is responsible for routing and handling requests internall y. The implementation takes advantage of `serverless-wsgi`, which allows you to wrap WSGI applications such as Flask apps. To learn more about `serverless-wsgi`, please refer to corresponding [GitHub repository](https://github.com/logandk/serverless-wsgi). Additionally, the template relies on `serverless-python-requirements` plugin for packaging dependencies from `requirements.txt` file. For more details about `serverless-python-requirements` configuration, please refer to corresponding [GitHub repository](https://github.com/UnitedIncome/serverless-python-requirements).
0 commit comments