{"library":"serverless","title":"Serverless Framework","description":"The Serverless Framework is a powerful command-line interface (CLI) tool designed for deploying serverless applications, primarily leveraging AWS services like Lambda, API Gateway, and DynamoDB. It enables developers to define both their application code and the necessary cloud infrastructure using declarative YAML configurations. Currently in its v4 series (e.g., v4.34.0 as of the latest release info), it undergoes active development with frequent minor and patch releases. The framework supports multiple programming runtimes including Node.js, Python, Go, and Java. Key differentiators include its extensive extensibility via a plugin ecosystem, the recent integration of popular community plugins (e.g., AppSync, Prune) into its core, and built-in support for advanced features like Durable Functions and S3 Filesystem mounts for Lambda. It aims to optimize for cost-effectiveness, auto-scaling, and reduced maintenance by abstracting complex cloud provisioning, facilitating the entire application lifecycle from development to deployment.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install serverless"],"cli":{"name":"serverless","version":null}},"imports":["import Serverless from 'serverless';","import type { ServiceConfig } from 'serverless';","import { ServerlessError } from 'serverless';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"service: my-serverless-app\n\nframeworkVersion: '4'\n\nprovider:\n  name: aws\n  runtime: nodejs20.x\n  region: us-east-1\n  environment:\n    MY_API_KEY: ${env:MY_API_KEY, 'default_key'}\n\nfunctions:\n  hello:\n    handler: handler.hello\n    events:\n      - httpApi:\n          path: /hello\n          method: get\n\nplugins:\n  - serverless-offline # Example plugin\n\n# handler.js\n// module.exports.hello = async (event) => {\n//   return {\n//     statusCode: 200,\n//     body: JSON.stringify(\n//       {\n//         message: `Hello from Serverless! API Key: ${process.env.MY_API_KEY}`,\n//         input: event,\n//       },\n//       null,\n//       2\n//     ),\n//   };\n// };\n\n# To deploy: \n# npm install -g serverless\n# sls deploy\n# To run locally with serverless-offline (if installed):\n# sls offline\n","lang":"yaml","description":"This quickstart defines a basic AWS Lambda function with an API Gateway endpoint using `serverless.yml`. It shows a minimal configuration for a Node.js function, demonstrates environment variable usage, and includes typical CLI commands for deployment and local development.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}