@goldstack/template-lambda-http-cli 0.5.31
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 +8 -0
- package/bin/template +12 -0
- package/bin/template.ts +6 -0
- package/dist/scripts/generateSchemas.d.ts +2 -0
- package/dist/scripts/generateSchemas.d.ts.map +1 -0
- package/dist/scripts/generateSchemas.js +5 -0
- package/dist/scripts/generateSchemas.js.map +1 -0
- package/dist/src/templateLambdaHttp.d.ts +3 -0
- package/dist/src/templateLambdaHttp.d.ts.map +1 -0
- package/dist/src/templateLambdaHttp.js +56 -0
- package/dist/src/templateLambdaHttp.js.map +1 -0
- package/dist/src/types/LambdaHttpPackage.d.ts +61 -0
- package/dist/src/types/LambdaHttpPackage.d.ts.map +1 -0
- package/dist/src/types/LambdaHttpPackage.js +3 -0
- package/dist/src/types/LambdaHttpPackage.js.map +1 -0
- package/docs/index.html +970 -0
- package/docs/template-configure.html +66 -0
- package/docs/template.html +106 -0
- package/package.json +83 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<p></p>
|
|
2
|
+
<div class="markdown-fragment">
|
|
3
|
+
<p>
|
|
4
|
+
Goldstack's Lambda Express module provides a basic Express.js server that is
|
|
5
|
+
deployed as an AWS lambda function.
|
|
6
|
+
</p>
|
|
7
|
+
</div>
|
|
8
|
+
<p></p>
|
|
9
|
+
<p></p>
|
|
10
|
+
<div class="markdown-fragment">
|
|
11
|
+
<p>The following key properties need to be configured for this module:</p>
|
|
12
|
+
<ul>
|
|
13
|
+
<li>
|
|
14
|
+
<strong>Lambda Name</strong>: The
|
|
15
|
+
<a
|
|
16
|
+
href="https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-FunctionName"
|
|
17
|
+
class="absolute"
|
|
18
|
+
target="_blank"
|
|
19
|
+
rel="noopener noreferrer"
|
|
20
|
+
>name</a
|
|
21
|
+
>
|
|
22
|
+
to be used for this lambda. Lambda names need to be unique for the AWS
|
|
23
|
+
Region. It is not possible to have two lambdas with the same name in the
|
|
24
|
+
same region.
|
|
25
|
+
</li>
|
|
26
|
+
<li>
|
|
27
|
+
<strong>API Domain</strong>: The domain where the API should be deployed
|
|
28
|
+
to. For instance, to be able to call the API endpoint
|
|
29
|
+
<code class="inline">https://api.mydomain.com/</code> the API domain
|
|
30
|
+
<code class="inline">api.mydomain.com</code> needs to be configured.
|
|
31
|
+
</li>
|
|
32
|
+
<li>
|
|
33
|
+
<strong>Hosted Zone Domain</strong>: A Route 53 hosted zone that will
|
|
34
|
+
allow adding the <em>API Domain</em> as a record. For instance, in order
|
|
35
|
+
to configure the API domain <code class="inline">api.mydomain.com</code>,
|
|
36
|
+
the hosted zones <code class="inline">api.mydomain.com</code> or
|
|
37
|
+
<code class="inline">mydomain.com</code> would be valid. For more details,
|
|
38
|
+
please check
|
|
39
|
+
<a
|
|
40
|
+
href="https://docs.goldstack.party/docs/goldstack/configuration#hosted-zone-configuration"
|
|
41
|
+
class="absolute"
|
|
42
|
+
target="_blank"
|
|
43
|
+
rel="noopener noreferrer"
|
|
44
|
+
>Hosted Zone Configuration</a
|
|
45
|
+
>
|
|
46
|
+
in the Goldstack documentation.
|
|
47
|
+
</li>
|
|
48
|
+
<li>
|
|
49
|
+
<strong>CORS Header</strong>: An optional CORS header to enable a UI that
|
|
50
|
+
is hosted on a different domain to access this API. For instance, for a UI
|
|
51
|
+
that is deployed to the domain
|
|
52
|
+
<code class="inline">ui.mydomain.com</code> the CORS header
|
|
53
|
+
<code class="inline">https://ui.mydomain.com</code> should be supplied. To
|
|
54
|
+
learn more about CORS, see the
|
|
55
|
+
<a
|
|
56
|
+
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"
|
|
57
|
+
class="absolute"
|
|
58
|
+
target="_blank"
|
|
59
|
+
rel="noopener noreferrer"
|
|
60
|
+
>Cross-Origin Resource Sharing (CORS)</a
|
|
61
|
+
>
|
|
62
|
+
in the MDN docs.
|
|
63
|
+
</li>
|
|
64
|
+
</ul>
|
|
65
|
+
</div>
|
|
66
|
+
<p></p>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<p></p>
|
|
2
|
+
<div class="markdown-fragment">
|
|
3
|
+
<p>
|
|
4
|
+
This module provides a basic Express.js server that is deployed as an AWS
|
|
5
|
+
lambda function.
|
|
6
|
+
</p>
|
|
7
|
+
</div>
|
|
8
|
+
<p></p>
|
|
9
|
+
<h2 class="heading">
|
|
10
|
+
<span id="configure"></span><a href="#configure">Configure</a
|
|
11
|
+
><span class="permalink"
|
|
12
|
+
><svg viewBox="0 0 16 16" width="16" height="16">
|
|
13
|
+
<g stroke-width="1" fill="#000000" stroke="#000000">
|
|
14
|
+
<path
|
|
15
|
+
fill="none"
|
|
16
|
+
stroke-linecap="round"
|
|
17
|
+
stroke-linejoin="round"
|
|
18
|
+
stroke-miterlimit="10"
|
|
19
|
+
d="M8.995,7.005 L8.995,7.005c1.374,1.374,1.374,3.601,0,4.975l-1.99,1.99c-1.374,1.374-3.601,1.374-4.975,0l0,0c-1.374-1.374-1.374-3.601,0-4.975 l1.748-1.698"
|
|
20
|
+
></path>
|
|
21
|
+
<path
|
|
22
|
+
fill="none"
|
|
23
|
+
stroke="#000000"
|
|
24
|
+
stroke-linecap="round"
|
|
25
|
+
stroke-linejoin="round"
|
|
26
|
+
stroke-miterlimit="10"
|
|
27
|
+
d="M7.005,8.995 L7.005,8.995c-1.374-1.374-1.374-3.601,0-4.975l1.99-1.99c1.374-1.374,3.601-1.374,4.975,0l0,0c1.374,1.374,1.374,3.601,0,4.975 l-1.748,1.698"
|
|
28
|
+
></path>
|
|
29
|
+
</g></svg
|
|
30
|
+
></span>
|
|
31
|
+
</h2>
|
|
32
|
+
<p></p>
|
|
33
|
+
<div class="markdown-fragment">
|
|
34
|
+
<p>The following key properties need to be configured for this module:</p>
|
|
35
|
+
<ul>
|
|
36
|
+
<li>
|
|
37
|
+
<strong>Lambda Name</strong>: The
|
|
38
|
+
<a
|
|
39
|
+
href="https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-FunctionName"
|
|
40
|
+
class="absolute"
|
|
41
|
+
target="_blank"
|
|
42
|
+
rel="noopener noreferrer"
|
|
43
|
+
>name</a
|
|
44
|
+
>
|
|
45
|
+
to be used for this lambda. This needs to be unique per AWS region.
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<strong>API Domain</strong>: The domain where the API should be deployed
|
|
49
|
+
to. For instance, to be able to call the API endpoint
|
|
50
|
+
<code class="inline">https://api.mydomain.com/</code> the API domain
|
|
51
|
+
<code class="inline">api.mydomain.com</code> needs to be configured.
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<strong>Hosted Zone Domain</strong>: A
|
|
55
|
+
<a
|
|
56
|
+
href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zones-working-with.html"
|
|
57
|
+
class="absolute"
|
|
58
|
+
target="_blank"
|
|
59
|
+
rel="noopener noreferrer"
|
|
60
|
+
>Route 53 hosted zone</a
|
|
61
|
+
>
|
|
62
|
+
that will allow adding the <em>API Domain</em> as a record. For instance,
|
|
63
|
+
in order to configure the API domain
|
|
64
|
+
<code class="inline">api.mydomain.com</code>, the hosted zones
|
|
65
|
+
<code class="inline">api.mydomain.com</code> or
|
|
66
|
+
<code class="inline">mydomain.com</code> would be valid. Note that this
|
|
67
|
+
hosted zone must already exist in AWS. Please find instructions of how to
|
|
68
|
+
set up a hosted zone
|
|
69
|
+
<a
|
|
70
|
+
href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html"
|
|
71
|
+
class="absolute"
|
|
72
|
+
target="_blank"
|
|
73
|
+
rel="noopener noreferrer"
|
|
74
|
+
>here</a
|
|
75
|
+
>.
|
|
76
|
+
</li>
|
|
77
|
+
</ul>
|
|
78
|
+
</div>
|
|
79
|
+
<p></p>
|
|
80
|
+
<h2 class="heading">
|
|
81
|
+
<span id="getting-started"></span
|
|
82
|
+
><a href="#getting-started">Getting Started</a
|
|
83
|
+
><span class="permalink"
|
|
84
|
+
><svg viewBox="0 0 16 16" width="16" height="16">
|
|
85
|
+
<g stroke-width="1" fill="#000000" stroke="#000000">
|
|
86
|
+
<path
|
|
87
|
+
fill="none"
|
|
88
|
+
stroke-linecap="round"
|
|
89
|
+
stroke-linejoin="round"
|
|
90
|
+
stroke-miterlimit="10"
|
|
91
|
+
d="M8.995,7.005 L8.995,7.005c1.374,1.374,1.374,3.601,0,4.975l-1.99,1.99c-1.374,1.374-3.601,1.374-4.975,0l0,0c-1.374-1.374-1.374-3.601,0-4.975 l1.748-1.698"
|
|
92
|
+
></path>
|
|
93
|
+
<path
|
|
94
|
+
fill="none"
|
|
95
|
+
stroke="#000000"
|
|
96
|
+
stroke-linecap="round"
|
|
97
|
+
stroke-linejoin="round"
|
|
98
|
+
stroke-miterlimit="10"
|
|
99
|
+
d="M7.005,8.995 L7.005,8.995c-1.374-1.374-1.374-3.601,0-4.975l1.99-1.99c1.374-1.374,3.601-1.374,4.975,0l0,0c1.374,1.374,1.374,3.601,0,4.975 l-1.748,1.698"
|
|
100
|
+
></path>
|
|
101
|
+
</g></svg
|
|
102
|
+
></span>
|
|
103
|
+
</h2>
|
|
104
|
+
<p></p>
|
|
105
|
+
<div class="markdown-fragment"></div>
|
|
106
|
+
<p></p>
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@goldstack/template-lambda-http-cli",
|
|
3
|
+
"version": "0.5.31",
|
|
4
|
+
"description": "Utilities for templates that allow a Lambda to function as a web server.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"goldstack",
|
|
7
|
+
"utility",
|
|
8
|
+
"lambda",
|
|
9
|
+
"aws",
|
|
10
|
+
"web",
|
|
11
|
+
"cloudfront",
|
|
12
|
+
"serverless",
|
|
13
|
+
"infrastructure",
|
|
14
|
+
"IaC",
|
|
15
|
+
"configuration"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://goldstack.party",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/goldstack/goldstack/issues"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/goldstack/goldstack.git"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "Max Rohde",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "dist/src/templateLambdaHttp.js",
|
|
29
|
+
"bin": {
|
|
30
|
+
"template": "./bin/template",
|
|
31
|
+
"template-lambda-http-cli": "./bin/template"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "yarn clean && yarn compile",
|
|
35
|
+
"build:watch": "yarn clean && yarn compile-watch",
|
|
36
|
+
"clean": "rimraf ./dist",
|
|
37
|
+
"cli": "ts-node bin/template.ts",
|
|
38
|
+
"compile": "tsc -p tsconfig.json",
|
|
39
|
+
"compile-watch": "tsc -p tsconfig.json --watch",
|
|
40
|
+
"compile-watch:light": "nodemon --watch ./src/ -e '*' --exec 'yarn compile'",
|
|
41
|
+
"coverage": "jest --collect-coverage --passWithNoTests --config=./jest.config.js --runInBand",
|
|
42
|
+
"generate-schema": "ts-node scripts/generateSchemas.ts && cp schemas/* ../../../templates/packages/lambda-express/schemas && cp schemas/* ../../../templates/packages/lambda-go-gin/schemas",
|
|
43
|
+
"prepublishOnly": "yarn run build",
|
|
44
|
+
"publish": "utils-git changed --exec \"yarn npm publish $@\"",
|
|
45
|
+
"test-ci": "jest --passWithNoTests --config=./jest.config.js --runInBand",
|
|
46
|
+
"version:apply": "utils-git changed --exec \"yarn version $@ && yarn version apply\"",
|
|
47
|
+
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@goldstack/infra": "0.4.12",
|
|
51
|
+
"@goldstack/infra-aws": "0.4.20",
|
|
52
|
+
"@goldstack/template-lambda-cli": "0.1.1",
|
|
53
|
+
"@goldstack/utils-aws-lambda": "0.3.25",
|
|
54
|
+
"@goldstack/utils-cli": "0.3.10",
|
|
55
|
+
"@goldstack/utils-config": "0.4.12",
|
|
56
|
+
"@goldstack/utils-log": "0.3.11",
|
|
57
|
+
"@goldstack/utils-package": "0.4.12",
|
|
58
|
+
"@goldstack/utils-package-config": "0.4.12",
|
|
59
|
+
"@goldstack/utils-template": "0.4.12",
|
|
60
|
+
"@goldstack/utils-terraform": "0.4.23",
|
|
61
|
+
"@goldstack/utils-terraform-aws": "0.4.26",
|
|
62
|
+
"source-map-support": "^0.5.21",
|
|
63
|
+
"yargs": "^17.5.1"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@goldstack/utils-docs-cli": "0.3.11",
|
|
67
|
+
"@goldstack/utils-git": "0.2.9",
|
|
68
|
+
"@goldstack/utils-package-config-generate": "0.3.10",
|
|
69
|
+
"@swc/core": "^1.3.74",
|
|
70
|
+
"@swc/jest": "^0.2.27",
|
|
71
|
+
"@types/jest": "^29.0.1",
|
|
72
|
+
"@types/node": "^18.7.13",
|
|
73
|
+
"@types/yargs": "^17.0.10",
|
|
74
|
+
"jest": "^29.3.1",
|
|
75
|
+
"rimraf": "^3.0.2",
|
|
76
|
+
"ts-json-schema-generator": "^1.0.0",
|
|
77
|
+
"ts-node": "^10.9.1",
|
|
78
|
+
"typescript": "^4.8.4"
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"main": "dist/src/templateLambdaHttp.js"
|
|
82
|
+
}
|
|
83
|
+
}
|