A simple folder structure for serverless apps which allows you to add middleware functions for each lambda handler.
functions (folder): Provide all your business logic within this folder.
index.js: Response for handler functions are generated within this file.
schema.js: Provide all your schema validation within this module.
A module for utility functions.
Collection of all Lambda handler functions.
You can use joi for schema validation.
git clone [email protected]:ankkho/serverless-folder-structure.git
-
npm i
-
sls offline start
Checkout serverless-offline. I would highly recommend this plugin! -
To invoke your lambda function either use postman or run a simple curl command
curl http://localhost:3000/sample/hello
.