Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sabinadams/knex-serverles-aws-sm
A set of AWS Lambda functions running Knex and AWS SM for creds
https://github.com/sabinadams/knex-serverles-aws-sm
Last synced: 23 days ago
JSON representation
A set of AWS Lambda functions running Knex and AWS SM for creds
- Host: GitHub
- URL: https://github.com/sabinadams/knex-serverles-aws-sm
- Owner: sabinadams
- Created: 2023-03-28T17:40:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:50:02.000Z (11 months ago)
- Last Synced: 2024-10-03T22:41:50.056Z (about 1 month ago)
- Language: TypeScript
- Size: 85 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Framework AWS Node.js Example
This template demonstrates how to deploy a Node.js function running on AWS Lambda using the traditional Serverless Framework. The deployed function does not include any event definitions as well as any kind of persistence (database). For more advanced configurations check out the [examples repo](https://github.com/serverless/examples/) which includes integrations with SQS, DynamoDB or examples of functions that are triggered in `cron`-like manner. For details about configuration of specific `events`, please refer to our [documentation](https://www.serverless.com/framework/docs/providers/aws/events/).
## Usage
### Deployment
In order to deploy the example, you need to run the following command:
```
$ serverless deploy
```After running deploy, you should see output similar to:
```bash
Deploying aws-node-project to stage dev (us-east-1)✔ Service deployed to stack aws-node-project-dev (112s)
functions:
hello: aws-node-project-dev-hello (1.5 kB)
```### Invocation
After successful deployment, you can invoke the deployed function by using the following command:
```bash
serverless invoke --function hello
```Which should result in response similar to the following:
```json
{
"statusCode": 200,
"body": "{\n \"message\": \"Go Serverless v3.0! Your function executed successfully!\",\n \"input\": {}\n}"
}
```### Local development
You can invoke your function locally by using the following command:
```bash
serverless invoke local --function hello
```Which should result in response similar to the following:
```
{
"statusCode": 200,
"body": "{\n \"message\": \"Go Serverless v3.0! Your function executed successfully!\",\n \"input\": \"\"\n}"
}
```