A framework to easy develop, test and deploy serverless RESTFul APIs on AWS API Gateway + Lambda Functions services through serverless.com framework.
serverless.com framework is great, because it allows you to easily deploy RESTFul APIs.
But the developer experience isn't 100% satisfying. These are some problems we have encountered:
- Compiling the configuration file (serverless.yml) by hand is tedious
- Creating an endpoint involves creating at least one handler file that must be manually linked in the configuration file
- A single serverless configuration file allows the creation of up to 200 resources on AWS (corresponding to about 20 APIs)
- There is no out of the box method to handle cold starts
- Project structure, unit testing, CD/CI configuration, is up to the developer
Restlessness framework allows you to:
- Create a brand new serverless.com project (based on Typescript) with a CLI command and a standard structure
- Create models and endpoints through and easy Web interface running locally
- Manage more serverless micro-services all connected to the same API Gateway through the Web interface
- Develop locally your project with an out-of-the-box integration of serverless-offline plugin
- Test your endpoints with a custom TestHandler function and jest
- Deploy all your services with a single CLI command
For each endpoint created, Restlessness creates furthermore:
- An index file automatically imported into the serverless.com configuration file
- A Typescript interface file that allows you to define the endpoint parameters (query string, payload, path parameters)
- A yup-based endpoint parameters validation file
- A handler file linked to the interface and validations file
- A unit test boilerplate based on jest
Restlessness is a multi-package framework. The main one is the CLI package.
To install the CLI run:
npm i @restlessness/cli -g
To create a new project run:
restlessness new projectName
This will create a new restlessness project inside your cwd with all the boilerplate you need to develop, test and deploy your app. It will also install all npm dependencies.
To develop your project run:
npm run DEV:locale
This commands will run:
- your project locally with serverless-offline plugin
- a Web Interface to interact with it
Thanks to this web interface you can:
- Create new serverless micro-services
- Create new endpoints
- Create new models
- Test you endpoints with an integrated Swagger UI