@travetto/web-aws-lambda 6.0.2 → 7.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +6 -6
- package/src/handler.ts +5 -5
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install @travetto/web-aws-lambda
|
|
|
13
13
|
yarn add @travetto/web-aws-lambda
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
This module provides an adapter between [Web API](https://github.com/travetto/travetto/tree/main/module/web#readme "Declarative
|
|
16
|
+
This module provides an adapter between [Web API](https://github.com/travetto/travetto/tree/main/module/web#readme "Declarative support for creating Web Applications") and [AWS Lambda](https://aws.amazon.com/lambda/). The event-driven invocation model for [Web API](https://github.com/travetto/travetto/tree/main/module/web#readme "Declarative support for creating Web Applications") aligns cleanly with [AWS Lambda](https://aws.amazon.com/lambda/)'s model for event-driven operation.
|
|
17
17
|
|
|
18
18
|
**NOTE:** The only caveat to consider, is that while the framework supports streams for responses, [AWS Lambda](https://aws.amazon.com/lambda/) does not. Any streaming result will be read and converted into a [Buffer](https://nodejs.org/api/buffer.html) before being sent back.
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ This module provides an adapter between [Web API](https://github.com/travetto/tr
|
|
|
23
23
|
```bash
|
|
24
24
|
$ trv pack:lambda -h
|
|
25
25
|
|
|
26
|
-
Usage: pack:lambda [options]
|
|
26
|
+
Usage: pack:lambda [options] [args...:string]
|
|
27
27
|
|
|
28
28
|
Options:
|
|
29
29
|
-b, --build-dir <string> Workspace for building (default: "/tmp/<temp-folder>")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/web-aws-lambda",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-rc.0",
|
|
4
4
|
"description": "Web APIs entry point support for AWS Lambdas.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"directory": "module/web-aws-lambda"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/web": "^
|
|
29
|
-
"@types/aws-lambda": "^8.10.
|
|
28
|
+
"@travetto/web": "^7.0.0-rc.0",
|
|
29
|
+
"@types/aws-lambda": "^8.10.159"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^
|
|
33
|
-
"@travetto/pack": "^
|
|
34
|
-
"@travetto/test": "^
|
|
32
|
+
"@travetto/cli": "^7.0.0-rc.0",
|
|
33
|
+
"@travetto/pack": "^7.0.0-rc.0",
|
|
34
|
+
"@travetto/test": "^7.0.0-rc.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/test": {
|
package/src/handler.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type lambda from 'aws-lambda';
|
|
2
2
|
|
|
3
3
|
import { Runtime, ConsoleManager } from '@travetto/runtime';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DependencyRegistryIndex, Inject, Injectable } from '@travetto/di';
|
|
5
|
+
import { Registry } from '@travetto/registry';
|
|
6
6
|
import { ConfigurationService } from '@travetto/config';
|
|
7
7
|
import { StandardWebRouter } from '@travetto/web';
|
|
8
8
|
|
|
@@ -18,9 +18,9 @@ export class AwsLambdaWebHandler {
|
|
|
18
18
|
|
|
19
19
|
return async (event, context) => {
|
|
20
20
|
if (!this.inst) {
|
|
21
|
-
await
|
|
22
|
-
await
|
|
23
|
-
this.inst = await
|
|
21
|
+
await Registry.init();
|
|
22
|
+
await DependencyRegistryIndex.getInstance(ConfigurationService).then(v => v.initBanner());
|
|
23
|
+
this.inst = await DependencyRegistryIndex.getInstance(AwsLambdaWebHandler);
|
|
24
24
|
}
|
|
25
25
|
return this.inst.handle(event, context);
|
|
26
26
|
};
|