Loading repository data…
Loading repository data…
hanoak / repository
A minimal boilerplate template for AWS Lambda in Javascript Node.js
This repository is a boilerplate template for working with Lambda functions in Javascript Node.js. It has all the setups in place for a) Local development b) Lambda environment c) Lambda environment with image-based functions. It has build scripts to build and deploy code to a lambda function, and much more.
This boilerplate has the following things:
src/config: It contains all the app’s configuration
src/constants: It contains all the app’s constants either strings, arrays, objects, etc.
src/services: It contains common function _makeApiCall() to make API external APIs. You can add other function to use_makeApiCall() to make your own API calls.
src/utils: It has all the app’s utility functions used across the app.
src/vendors: It contains all the code related to your vendor or third-party packages/CLIs, SDKs.
npm i
npm run dev
docker build --platform linux/x86_64 -t docker-image-name .
docker run --platform linux/x86_64 -p 9000:8080 docker-image-name
API endpoint will be opened on: http://localhost:9000/2015-03-31/functions/function/invocations
Executing the below command will automatically build & deploy your code to the lambda function including the node_modules for production:
bash build.sh <your-lambda-function-name> <aws-region>