https://github.com/lambda-lambda-lambda/router
:zap: AWS CloudFront Lambda@Edge serverless application router.
https://github.com/lambda-lambda-lambda/router
aws functions lambda-edge nodejs router serverless
Last synced: 7 days ago
JSON representation
:zap: AWS CloudFront Lambda@Edge serverless application router.
- Host: GitHub
- URL: https://github.com/lambda-lambda-lambda/router
- Owner: lambda-lambda-lambda
- License: mit
- Created: 2023-03-22T16:27:00.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-10-05T04:30:19.000Z (4 months ago)
- Last Synced: 2025-10-05T04:41:43.350Z (4 months ago)
- Topics: aws, functions, lambda-edge, nodejs, router, serverless
- Language: JavaScript
- Homepage: https://lambda-lambda-lambda.github.io/doc
- Size: 1.02 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# L³ router
[](https://badge.fury.io/js/@lambda-lambda-lambda%2Frouter) [](https://www.npmjs.com/package/@lambda-lambda-lambda/router) [](https://github.com/lambda-lambda-lambda/router/actions) [](https://coveralls.io/r/lambda-lambda-lambda/router?branch=master) [](https://packagephobia.com/result?p=@lambda-lambda-lambda/router) [](https://github.com/nuxy/no-ai-badge)
AWS [CloudFront Lambda@Edge](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html) serverless application router.

## Features
- Request/Response handling [API](https://github.com/lambda-lambda-lambda/manual/blob/master/CommonMethods.md).
- [Routes](https://github.com/lambda-lambda-lambda/manual/blob/master/ComplexRouting.md#route-handler) and URI [Resource](https://github.com/lambda-lambda-lambda/manual/blob/master/ComplexRouting.md#resource-handler) support.
- Local/Globally scoped [Middleware](https://github.com/lambda-lambda-lambda/manual/blob/master/Middleware.md#scope).
- [Visual Studio Code](https://code.visualstudio.com) integration.
- Open Source, [MIT licensed](https://github.com/lambda-lambda-lambda/router/blob/master/LICENSE), FREE.
- Lightweight (**no dependencies**).
## How does it work?
In its most basic form the library provides helper methods that translate the [CloudFront Lambda@Edge](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html) `origin-request` allowing you to handle response processing **without the need to construct complex Lambda dependent responses**.
To better visualize how L³ fits in the current AWS ecosystem the following high-level graph describes the _HTTP Request/Response lifecycle_ and role of each AWS provided service.

## Getting started
The easiest way to created an application, without the need to [manually install](#manual-installation) this package, is to use the [L³ Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=Nuxy.vscode-lambda-lambda-lambda). Doing so allows you to..
- Scaffold app sources and dependencies.
- Run it locally (in [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers))
- Test code changes in realtime.
- Deploy app sources to AWS.
- Generate [JSDoc](https://jsdoc.app)/[Swagger](https://swagger.io) documentation.
## Build dependencies
If you're not using the [L³ VS Code extension](https://marketplace.visualstudio.com/items?itemName=Nuxy.vscode-lambda-lambda-lambda) and want to _run this package locally_ you must install the following dependencies:
- [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
- [Node.js](https://nodejs.org)
## Manual installation
If you just looking to leverage the Request/Response handling [API](CommonMethods.md) in your Lambda functions, install this package using [NPM](https://npmjs.com).
$ npm install @lambda-lambda-lambda/router
## Documentation
- [Introduction](https://github.com/lambda-lambda-lambda/manual/blob/master/Introduction.md)
- [Getting Started](https://github.com/lambda-lambda-lambda/manual/blob/master/GettingStarted.md)
- [AWS requirements](https://github.com/lambda-lambda-lambda/manual/blob/master/AWSRequirements.md)
- [Running your App](https://github.com/lambda-lambda-lambda/manual/blob/master/RunningYourApp.md)
- [Usage](https://github.com/lambda-lambda-lambda/manual/blob/master/Usage.md)
- [Common methods](https://github.com/lambda-lambda-lambda/manual/blob/master/CommonMethods.md)
- [Complex routing](https://github.com/lambda-lambda-lambda/manual/blob/master/ComplexRouting.md)
- [Middleware](https://github.com/lambda-lambda-lambda/manual/blob/master/Middleware.md)
- [Developers](https://github.com/lambda-lambda-lambda/manual/blob/master/Developers.md)
- [Testing](https://github.com/lambda-lambda-lambda/manual/blob/master/Testing.md)
## AWS changes starting in Node.js 24 (CloudWatch warning)
Going forward, it is recommended that you build your L³ application using `async` handlers in anticipation of the AWS changes below.
> AWS Lambda plans to remove support for callback-based function handlers starting with Node.js 24. You will need to update this function to use an async handler to use Node.js 24 or later. For more information and to provide feedback on this change, see aws/aws-lambda-nodejs-runtime-interface-client#137
While backwards compatibity will be supported for older Node.js releases this support **will eventually be phased out** with the deprecation of `nodejs22.x` (Apr 30, 2027).
See [AWS Node.js Supported Runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported) for support information.
## Versioning
This package is maintained under the [Semantic Versioning](https://semver.org) guidelines.
## License and Warranty
This package is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
_lambda-lambda-lambda/router_ is provided under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.php)
[AWS](https://aws.amazon.com) is a registered trademark of Amazon Web Services, Inc.
## Author
[Marc S. Brooks](https://github.com/nuxy)