Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 934 Bytes

README.md

File metadata and controls

30 lines (17 loc) · 934 Bytes

serverless-folder-structure

A simple folder structure for serverless apps which allows you to add middleware functions for each lambda handler.

lib

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.

util.js:

A module for utility functions.

handler.js:

Collection of all Lambda handler functions.

You can use joi for schema validation.

How to run this example

git clone [email protected]:ankkho/serverless-folder-structure.git

  1. npm i

  2. sls offline start Checkout serverless-offline. I would highly recommend this plugin!

  3. To invoke your lambda function either use postman or run a simple curl command curl http://localhost:3000/sample/hello.