@@ -44,43 +44,56 @@ You may have heard that a serverless "best practice" is to keep your functions s
44
44
Whatever you decide is best for your use case, ** Lambda API** is there to support you. Whether your function has over a hundred routes, or just one, Lambda API's small size and lightning fast load time has virtually no impact on your function's performance. You can even define global wildcard routes that will process any incoming request, allowing you to use API Gateway or ALB to determine the routing. Yet despite its small footprint, it gives you the power of a full-featured web framework.
45
45
46
46
## Table of Contents
47
+ - [ Simple Example] ( #simple-example )
48
+ - [ Why Another Web Framework?] ( #why-another-web-framework )
49
+ - [ Single Purpose Functions] ( #single-purpose-functions )
50
+ - [ Table of Contents] ( #table-of-contents )
47
51
- [ Installation] ( #installation )
48
52
- [ Requirements] ( #requirements )
49
53
- [ Configuration] ( #configuration )
50
54
- [ Recent Updates] ( #recent-updates )
55
+ - [ v0.10: ALB support, method-based middleware, and multi-value headers and query string parameters] ( #v010-alb-support-method-based-middleware-and-multi-value-headers-and-query-string-parameters )
56
+ - [ v0.9: New error types, custom serializers, and TypeScript support] ( #v09-new-error-types-custom-serializers-and-typescript-support )
57
+ - [ v0.8: Logging support with sampling] ( #v08-logging-support-with-sampling )
58
+ - [ v0.7: Restrict middleware execution to certain paths] ( #v07-restrict-middleware-execution-to-certain-paths )
59
+ - [ v0.6: Support for both ` callback-style ` and ` async-await ` ] ( #v06-support-for-both-callback-style-and-async-await )
60
+ - [ v0.5: Remove Bluebird promises dependency] ( #v05-remove-bluebird-promises-dependency )
61
+ - [ v0.4: Binary support] ( #v04-binary-support )
62
+ - [ v0.3: New instantiation method] ( #v03-new-instantiation-method )
51
63
- [ Routes and HTTP Methods] ( #routes-and-http-methods )
52
64
- [ Returning Responses] ( #returning-responses )
53
65
- [ Async/Await] ( #asyncawait )
54
66
- [ Promises] ( #promises )
67
+ - [ A Note About Flow Control] ( #a-note-about-flow-control )
55
68
- [ Route Prefixing] ( #route-prefixing )
56
69
- [ Debugging Routes] ( #debugging-routes )
57
70
- [ REQUEST] ( #request )
58
71
- [ RESPONSE] ( #response )
59
- - [ attachment()] ( #attachmentfilename )
60
- - [ cache()] ( #cacheage--private )
61
- - [ clearCookie()] ( #clearcookiename-options )
62
- - [ cookie()] ( #cookiename-value-options )
63
- - [ cors()] ( #corsoptions )
64
- - [ download()] ( #downloadfile--filename--options--callback )
65
- - [ error()] ( #errorcode-message-detail )
66
- - [ etag()] ( #etagboolean )
67
- - [ getHeader()] ( #getheaderkey-value--asarray )
72
+ - [ status(code)] ( #statuscode )
73
+ - [ sendStatus(code)] ( #sendstatuscode )
74
+ - [ header(key, value [ ,append] )] ( #headerkey-value-append )
75
+ - [ getHeader(key [ ,asArray] )] ( #getheaderkey-asarray )
68
76
- [ getHeaders()] ( #getheaders )
69
- - [ getLink()] ( #getlinks3path-expires-callback )
70
- - [ hasHeader()] ( #hasheaderkey )
71
- - [ header()] ( #headerkey-value--append )
72
- - [ html()] ( #htmlbody )
73
- - [ json()] ( #jsonbody )
74
- - [ jsonp()] ( #jsonpbody )
75
- - [ location] ( #locationpath )
76
- - [ modified()] ( #modifieddate )
77
- - [ redirect()] ( #redirectstatus-path )
78
- - [ removeHeader()] ( #removeheaderkey )
79
- - [ send()] ( #sendbody )
80
- - [ sendFile()] ( #sendfilefile--options--callback )
81
- - [ sendStatus()] ( #sendstatuscode )
82
- - [ status()] ( #statuscode )
83
- - [ type()] ( #typetype )
77
+ - [ hasHeader(key)] ( #hasheaderkey )
78
+ - [ removeHeader(key)] ( #removeheaderkey )
79
+ - [ getLink(s3Path [ , expires] [ , callback] )] ( #getlinks3path--expires--callback )
80
+ - [ send(body)] ( #sendbody )
81
+ - [ json(body)] ( #jsonbody )
82
+ - [ jsonp(body)] ( #jsonpbody )
83
+ - [ html(body)] ( #htmlbody )
84
+ - [ type(type)] ( #typetype )
85
+ - [ location(path)] ( #locationpath )
86
+ - [ redirect([ status,] path)] ( #redirectstatus-path )
87
+ - [ cors([ options] )] ( #corsoptions )
88
+ - [ error([ code] , message [ ,detail] )] ( #errorcode-message-detail )
89
+ - [ cookie(name, value [ ,options] )] ( #cookiename-value-options )
90
+ - [ clearCookie(name [ ,options] )] ( #clearcookiename-options )
91
+ - [ etag([ boolean] )] ( #etagboolean )
92
+ - [ cache([ age] [ , private] )] ( #cacheage--private )
93
+ - [ modified(date)] ( #modifieddate )
94
+ - [ attachment([ filename] )] ( #attachmentfilename )
95
+ - [ download(file [ , filename] [ , options] [ , callback] )] ( #downloadfile--filename--options--callback )
96
+ - [ sendFile(file [ , options] [ , callback] )] ( #sendfilefile--options--callback )
84
97
- [ Enabling Binary Support] ( #enabling-binary-support )
85
98
- [ Path Parameters] ( #path-parameters )
86
99
- [ Wildcard Routes] ( #wildcard-routes )
@@ -94,6 +107,9 @@ Whatever you decide is best for your use case, **Lambda API** is there to suppor
94
107
- [ Serializers] ( #serializers )
95
108
- [ Sampling] ( #sampling )
96
109
- [ Middleware] ( #middleware )
110
+ - [ Restricting middleware execution to certain path(s)] ( #restricting-middleware-execution-to-certain-paths )
111
+ - [ Specifying multiple middleware] ( #specifying-multiple-middleware )
112
+ - [ Method-based middleware] ( #method-based-middleware )
97
113
- [ Clean Up] ( #clean-up )
98
114
- [ Error Handling] ( #error-handling )
99
115
- [ Error Types] ( #error-types )
@@ -104,9 +120,11 @@ Whatever you decide is best for your use case, **Lambda API** is there to suppor
104
120
- [ Lambda Proxy Integration] ( #lambda-proxy-integration )
105
121
- [ ALB Integration] ( #alb-integration )
106
122
- [ Configuring Routes in API Gateway] ( #configuring-routes-in-api-gateway )
123
+ - [ Reusing Persistent Connections] ( #reusing-persistent-connections )
107
124
- [ TypeScript Support] ( #typescript-support )
108
125
- [ Sponsors] ( #sponsors )
109
126
- [ Contributions] ( #contributions )
127
+ - [ Are you using Lambda API?] ( #are-you-using-lambda-api )
110
128
111
129
## Installation
112
130
```
@@ -1376,6 +1394,11 @@ exports.run = async (event: APIGatewayEvent, context: Context) => {
1376
1394
}
1377
1395
```
1378
1396
1397
+ ## Sponsors
1398
+
1399
+ [ ![ New Relic] ( https://user-images.githubusercontent.com/2053544/96728664-55238700-1382-11eb-93cb-82fe7cb5e043.png )] ( https://ad.doubleclick.net/ddm/trackclk/N1116303.3950900PODSEARCH.COM/B24770737.285235234;dc_trk_aid=479074825;dc_trk_cid=139488579;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;gdpr=${GDPR};gdpr_consent=${GDPR_CONSENT_755} )
1400
+ <IMG SRC =" https://ad.doubleclick.net/ddm/trackimp/N1116303.3950900PODSEARCH.COM/B24770737.285235234;dc_trk_aid=479074825;dc_trk_cid=139488579;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;gdpr=${GDPR};gdpr_consent=${GDPR_CONSENT_755}? " BORDER =" 0 " HEIGHT =" 1 " WIDTH =" 1 " ALT =" Advertisement " >
1401
+
1379
1402
## Contributions
1380
1403
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.
1381
1404
0 commit comments