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
Copy file name to clipboardExpand all lines: README.md
+16-27Lines changed: 16 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ The list of supported frameworks matches [in-process-request](https://github.com
10
10
* Connect v3
11
11
* Koa v2
12
12
13
-
14
13
Inspired by [aws-serverless-express](https://github.com/awslabs/aws-serverless-express)
15
14
16
15
It supports `nodejs8.10` and `nodejs10.x` execution environments.
17
16
18
17
The main differences between this module and `aws-serverless-express` are
19
18
* It's using [in-process-request](https://github.com/janaz/in-process-request) module to execute app handlers in-process without having to start background http server
20
19
* Simpler setup as it doesn't require managing the internal http server
20
+
* Support for applications that require asynchronous setup (for example reading config from network, or decrypting secrets from KMS)
21
21
* It's faster, because it doesn't need to pass the request to the internal server through the unix socket
22
22
* It's free from issues caused by limits in Node.js http module such as header size limit
23
23
@@ -49,45 +49,34 @@ module.exports = { handler }
49
49
50
50
If the above file in your Lambda source was called `index.js` then the name of the handler in the Lambda configuration is `index.handler`
51
51
52
-
### Advanced example
52
+
### Advanced example with asynchronous setup
53
53
54
-
Sometimes the application needs to read configuration from remote source before it can start processing requests. For example it may need to decrypt some secrets managed by KMS.
54
+
Sometimes the application needs to read configuration from remote source before it can start processing requests. For example it may need to decrypt some secrets managed by KMS. For this use case a special helper `deferred` has been provided. It takes a factory function which returns a Promise that resolves to the app instance. The factory function will be called only once.
0 commit comments