Serverless NodeJS File/Folder Structure

Viewed 4046

I'm setting up my first project using serverless and while I'm finding a lot of great "getting started" tutorials, I'm having a hard time finding anything about actual project structure.

My thoughts is to use the below structure for my functions, shared libs and core configuration/dependencies:

.
├── functions/
│   │
│   ├── users/
│   │   ├── handler.js
│   │   └── serverless.yml
│   │
│   └── roles/
│       ├── handler.js
│       └── serverless.yml
│
├── shared/
│   └── common.js
│   
├── node_modules/
└── package.json

My main curiosity is around deployment and how that pertains to dependencies and shared files. Additionally, automating deploy of this structure seems strange as I'm gathering I would need to deploy each of the functions separately which I can script, but wondering if that's needed or advised.

1 Answers
Related