|
1 | 1 | [](https://serverless-api.com/)
|
2 | 2 |
|
3 |
| -[](https://travis-ci.org/jeremydaly/lambda-api) |
| 3 | +[](https://github.com/jeremydaly/lambda-api/actions/workflows/build.yml) |
4 | 4 | [](https://www.npmjs.com/package/lambda-api)
|
5 | 5 | [](https://www.npmjs.com/package/lambda-api)
|
6 |
| -[](https://coveralls.io/github/jeremydaly/lambda-api?branch=master) |
| 6 | +[](https://coveralls.io/github/jeremydaly/lambda-api?branch=main) |
7 | 7 |
|
8 | 8 | ### Lightweight web framework for your serverless applications
|
9 | 9 |
|
@@ -161,39 +161,6 @@ For detailed release notes see [Releases](https://github.com/jeremydaly/lambda-a
|
161 | 161 | ### v0.10: ALB support, method-based middleware, and multi-value headers and query string parameters
|
162 | 162 | Lambda API now allows you to seamlessly switch between API Gateway and Application Load Balancers. New [execution stacks](execution-stacks) enables method-based middleware and more wildcard functionality. Plus full support for multi-value headers and query string parameters.
|
163 | 163 |
|
164 |
| -### v0.9: New error types, custom serializers, and TypeScript support |
165 |
| -Lambda API now generates typed errors for easier parsing in middleware. You can also supply your own custom serializer for formatting output rather than using the default `JSON.stringify`. And thanks to @hassankhan, a TypeScript declaration file is now available. |
166 |
| - |
167 |
| -### v0.8: Logging support with sampling |
168 |
| -Lambda API has added a powerful (and customizable) logging engine that utilizes native JSON support for CloudWatch Logs. Log entries can be manually added using standard severities like `info` and `warn`. In addition, "access logs" can be automatically generated with detailed information about each requests. See [Logging](#logging) for more information about logging and auto sampling for request tracing. |
169 |
| - |
170 |
| -### v0.7: Restrict middleware execution to certain paths |
171 |
| -Middleware now supports an optional path parameter that supports multiple paths, wildcards, and parameter matching to better control middleware execution. See [middleware](#middleware) for more information. |
172 |
| - |
173 |
| -### v0.6: Support for both `callback-style` and `async-await` |
174 |
| -In additional to `res.send()`, you can now simply `return` the body from your route and middleware functions. See [Returning Responses](#returning-responses) for more information. |
175 |
| - |
176 |
| -### v0.5: Remove Bluebird promises dependency |
177 |
| -Now that AWS Lambda supports Node v8.10, asynchronous operations can be handled more efficiently with `async/await` rather than with promises. The core Lambda API execution engine has been rewritten to take advantage of `async/await`, which means we no longer need to depend on Bluebird. We now have **ZERO** dependencies. |
178 |
| - |
179 |
| -### v0.4: Binary support |
180 |
| -Binary support has been added! This allows you to both send and receive binary files from API Gateway. For more information, see [Enabling Binary Support](#enabling-binary-support). |
181 |
| - |
182 |
| -### v0.3: New instantiation method |
183 |
| -Please note that the invocation method has been changed. You no longer need to use the `new` keyword to instantiate Lambda API. It can now be instantiated in one line: |
184 |
| - |
185 |
| - ```javascript |
186 |
| - const api = require('lambda-api')() |
187 |
| - ``` |
188 |
| - |
189 |
| -`lambda-api` returns a `function` now instead of a `class`, so options can be passed in as its only argument: |
190 |
| - |
191 |
| -```javascript |
192 |
| -const api = require('lambda-api')({ version: 'v1.0', base: 'v1' }); |
193 |
| -``` |
194 |
| - |
195 |
| -**IMPORTANT:** Upgrading from <v0.3.0 requires either removing the `new` keyword or switching to the one-line format. This provides more flexibility for instantiating Lambda API in future releases. |
196 |
| - |
197 | 164 | ## Routes and HTTP Methods
|
198 | 165 |
|
199 | 166 | Routes are defined by using convenience methods or the `METHOD` method. There are currently eight convenience route methods: `get()`, `post()`, `put()`, `patch()`, `delete()`, `head()`, `options()` and `any()`. Convenience route methods require an optional *route* and one or more handler functions. A *route* is simply a path such as `/users`. If a *route* is not provided, then it will default to `/*` and will execute on every path. Handler functions accept a `REQUEST`, `RESPONSE`, and optional `next()` argument. These arguments can be named whatever you like, but convention dictates `req`, `res`, and `next`.
|
|
0 commit comments