Loading...
Loading...
Serverless architecture with FaaS and BaaS. Use for cloud functions.
npx skill4agent add g1joshi/agent-skills serverless// AWS Lambda Handler (Node.js)
export const handler = async (event) => {
console.log("Event received:", JSON.stringify(event));
const name = event.queryStringParameters?.name || "World";
return {
statusCode: 200,
body: JSON.stringify({ message: `Hello, ${name}!` }),
};
};# serverless.yml (Serverless Framework)
service: my-api
provider:
name: aws
runtime: nodejs20.x
functions:
hello:
handler: handler.hello
events:
- httpApi:
path: /hello
method: get| Error | Cause | Solution |
|---|---|---|
| Function took too long. | Increase timeout setting; optimize code; move to async pattern. |
| Processing large files. | Increase RAM (allocates more CPU too); stream data instead of loading all in memory. |