generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedevent-handlerThis item relates to the Event Handler UtilityThis item relates to the Event Handler Utilityfeature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utility
Description
Use case
Currently, the Event Handler supports specific route patterns, but there's no built-in support for catch-all routes that can handle arbitrary paths. This is useful for:
- Creating fallback handlers for unmatched routes
- Building proxy-like functionality where you want to capture all requests under a certain path
- Implementing wildcard routing patterns
Solution/User Experience
Add support for catch-all routes using regex patterns like .+ that can match any path. This would allow developers to create flexible routing patterns that can handle multiple path segments.
import { APIGatewayResolver } from '@aws-lambda-powertools/event-handler/resolvers';
const app = new APIGatewayResolver();
app.get('.+', () => {
return {
message: 'Hello, World!'
};
});
export const handler = async (event, context) =>
app.resolve(event, context);Alternative solutions
Acknowledgment
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedevent-handlerThis item relates to the Event Handler UtilityThis item relates to the Event Handler Utilityfeature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utility
Type
Projects
Status
Shipped