Serverless framework example for launching a basic CRUD service.
-
Go to
shared/config.yml
in the repo's root directory. Change whatever you need to change there. These settings are then used by each service below for full consistency. This information also becomes available to each SLS service in your repo directory, by simplyvar Shared = require('shared');
and accessing theConfig
key, from right inside your SLS handler code. -
For local development, run
npm install
in the repo's root directory. This will install any dev dependency (likeserverless-offline
). -
That's it! Now you can go to each service and code your heart out.
To make full application deploy
and remove
simple, I've boiled them down to these two npm scripts
that you can easily run:
- Run
npm run info
tosls info
every service contained, getting a rundown of your app as a whole - Run
npm run deploy
tosls deploy
every service contained - Run
npm run remove
tosls remove
every service contained - Run
npm run offline
tosls offline
every service contained