You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a full tutorial see [How To: Build a Serverless API with Serverless, AWS Lambda and Lambda API](https://www.jeremydaly.com/build-serverless-api-serverless-aws-lambda-lambda-api/).
36
36
37
+
## TypeScript Support
38
+
39
+
Lambda API includes comprehensive TypeScript definitions out of the box. You can leverage type safety across your entire API:
- Full type inference for request and response objects
108
+
- Generic type parameters for response types
109
+
- Support for API Gateway and ALB contexts
110
+
- Type-safe query parameters, path parameters, and request body
111
+
- Middleware and error handler type definitions
112
+
- Automatic type inference for all HTTP methods
113
+
- Type safety for cookies, headers, and other API features
114
+
37
115
## Why Another Web Framework?
38
116
39
117
Express.js, Fastify, Koa, Restify, and Hapi are just a few of the many amazing web frameworks out there for Node.js. So why build yet another one when there are so many great options already? One word: **DEPENDENCIES**.
@@ -1479,33 +1557,6 @@ Simply create a `{proxy+}` route that uses the `ANY` method and all requests wil
1479
1557
1480
1558
If you are using persistent connections in your function routes (such as AWS RDS or Elasticache), be sure to set `context.callbackWaitsForEmptyEventLoop = false;` in your main handler. This will allow the freezing of connections and will prevent Lambda from hanging on open connections. See [here](https://www.jeremydaly.com/reuse-database-connections-aws-lambda/) for more information.
1481
1559
1482
-
## TypeScript Support
1483
-
1484
-
An `index.d.ts` declaration file has been included for use with your TypeScript projects (thanks @hassankhan). Please feel free to make suggestions and contributions to keep this up-to-date with future releases.
Contributions, ideas and bug reports are welcome and greatly appreciated. Please add [issues](https://github.com/jeremydaly/lambda-api/issues) for suggestions and bug reports or create a pull request.
0 commit comments