What is serverless?
The serverless npm package is a framework that allows you to build serverless applications using cloud providers like AWS Lambda, Azure Functions, Google Cloud Functions, and more. It abstracts away the infrastructure management tasks, enabling developers to focus on writing application logic.
What are serverless's main functionalities?
Deployment Automation
Automates the deployment of your serverless application to the cloud provider. The 'serverless deploy' command packages your application, uploads it to the cloud provider, and sets up the necessary services like AWS Lambda, API Gateway, etc.
serverless deploy
Function Invocation
Allows you to invoke a deployed function directly from the command line. The '-f' flag specifies the function name you want to invoke, in this case, 'hello'.
serverless invoke -f hello
Local Development
Enables local development and testing of serverless applications. The 'serverless offline' plugin simulates AWS Lambda and API Gateway on your local machine to speed up development cycles.
serverless offline start
Logs Retrieval
Retrieves logs for a specific function from the cloud provider. The '-f' flag specifies the function name whose logs you want to view, in this case, 'hello'.
serverless logs -f hello
Configuration Management
Allows you to define your serverless application's configuration in a 'serverless.yml' file. This includes the service name, provider details, runtime, functions, events, and other resources.
service: myService
provider:
name: aws
runtime: nodejs12.x
functions:
hello:
handler: handler.hello
0

Serverless Framework (BETA)
Serverless is the application framework for building serverless web, mobile and IoT applications. It's a command line interface that helps you build and maintain Serverless apps across teams of any size. It's completely extensible via Plugins and developed full-time by a dedicated team.
We believe AWS Lambda will be the focal point of AWS cloud, and the Serverless Framework approaches AWS from that perspective.
We work on this live in our Gitter Chatroom. Everyone is welcome :)
Install
Install The Serverless Framework via npm: (requires Node V4)
npm install serverless -g
Done! Refer to our documentation for next steps.
Features
- Run/test AWS Lambda functions locally
- Auto-deploy, version & alias your Lambda functions
- Auto-deploys your REST API to AWS API Gateway
- Support for multiple stages
- Support for multiple regions within stages
- Manage & deploy AWS CloudFormation resources
- Project Variables & Module Templates to reduce configuration settings
- Environment variable support
- Interactive dashboard to easily select and deploy functions and endpoints
- Optimize your Lambda functions for faster response times
- Components allow for easy sharing of code across Lambda functions
- Shareable project files and modules
- 100% Extensible - Extend or modify the Framework and its operations via Plugins
- Powerful classes and methods for easy plugin development
- AWS best practices and optimizations built in!
Links
Plugins
Serverless is comprised of Plugins. A group of default Plugins ship with the Framework, and here are some others you can add to improve/help your workflow:
- Plugin Boilerplate - Make a Serverless Plugin with this simple boilerplate.
- Serve - Simulate API Gateway locally, so all function calls can be run via localhost.
- Alerting - This Plugin adds Cloudwatch Alarms with SNS notifications for your Lambda functions.
- Optimizer - Optimizes your code for performance in Lambda.
- CORS - Adds support for CORS (Cross-origin resource sharing).
- CloudFormation Validator - Adds support for validating your CloudFormation template.
- Prune - Delete old versions of AWS lambdas from your account so that you don't exceed the code storage limit.
- Base-Path - Sets a base path for all API Gateway endpoints in a Component.
- Test - A Simple Integration Test Framework for Serverless.
Contributing
We love our contributors! If you'd like to contribute to the project, feel free to submit a PR. But please keep in mind the following guidelines:
- Propose your changes before you start working on a PR. You can reach us by submitting a Github issue, or discuss it in the Gitter Chatroom. This is just to make sure that no one else is working on the same change, and to figure out the best way to solve the issue.
- If you're out of ideas, but still want to contribute, check out our Road Map. There's a lot we want to get done, and we'd love your help!
- Contributions are not just PRs! We'd be grateful for having you in our community, and if you could provide some support for new comers, that be great! You can also do that by answering Serverless related questions on Stackoverflow.
- You can also contribute by writing. Feel free to let us know if you want to publish a useful original guide in our docs (attributed to you, thank you!) that you feel will help the community.