- Node.js.
- Yarn is required in order to run any project and install dependencies. The reason for this is Yarn's Workspaces feature that facilitates monorepo management.
- Serverless Framework
- (Optional) AWS CLI.
In order to deploy, you will need an IAM User and configure the credentials.
# Clone repository and `cd` to dir.
$ git clone https://github.com/esneyder/base-serverless.git
$ cd base-serverless
# Install dependecies
$ yarn install
# Create users service
$ yarn create-service users
# Run service offline (local)
$ yarn services users offline
# Deploy service
$ yarn services users deploy
To run any service script, run at the project root directory
$ yarn services your-service-name script-to-run
# Example
$ yarn services users deploy
$ yarn services users offline
$ yarn services users test
$ yarn services users add chalk
You can create new services by using a generator.
$ yarn create-service your-service-name
Loaded templates: _templates
added: services/your-service-name/handler.js
added: services/your-service-name/package.json
shell: yarn install
added: services/your-service-name/serverless.yml
Done in 11.43s.
A folder will be created at services/your-service-name
with some configured file.
Each services will have some scripts. These are:
offline
: Run the service in local usingserverless-offline
deploy
: Deploy the service to AWs.