Skip to content

Commit

Permalink
Add local testing info to README (#39)
Browse files Browse the repository at this point in the history
* Add local testing info to README

* typo fix
  • Loading branch information
s-egge committed Jul 3, 2024
1 parent a667b7c commit d860142
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@
![](https://github.com/OSU-Sustainability-Office/lambda-common-layer/actions/workflows/LCL-deploy.yml/badge.svg)

This package is used as a Lambda Layer to simplify accessing databases and user authentication between different lambda functions.

### Testing Locally

* Have Docker running
* Have AWS CLI installed to the latest version
* Install dependencies in root and in `dependencies\nodejs`
* Either decrypt the `.env.enc` or add the `.env` file in `dependencies\nodejs` (You need to be a paid OSU SO employee to view the credentials for this step)
* In root folder:
* `sam build`
* `sam local start-lambda`
* In a new terminal, still in root, you can now invoke the various lambda functions. [See the AWS docs here for more in depth info](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli-local-start-lambda.html).
* Example:
* `aws lambda invoke --function-name AuthLogin --endpoint-url 'http://127.0.0.1:3001' --no-verify-ssl out.txt`
* If successful, you will get a `"StatusCode": 200` output.

0 comments on commit d860142

Please sign in to comment.