Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 796bf83

Browse files
committed
Node 4.3 base image changed, readme updated
Signed-off-by: tzununbekov <t.zununbekov@gmail.com>
1 parent 3fb1c49 commit 796bf83

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,35 @@ tm deploy service python-test -f https://github.com/serverless/examples --build-
2121

2222
```
2323
curl python-test.default.dev.triggermesh.io
24+
2425
{"statusCode": 200, "body": "{\"message\": \"Hello, the current time is 06:45:49.174383\"}"}
2526
```
2627

2728

2829
To use Python 2.7 runtime simply replace version tag in step 1 and 2 with `python-2.7` and `aws-python27-runtime` accordingly.
2930

3031

32+
#### Nodejs
33+
34+
1. Install node 4.3 buildtemplate
35+
36+
```
37+
https://raw.githubusercontent.com/triggermesh/aws-lambda-runtime/master/node-4.x/buildtemplate.yaml
38+
```
39+
40+
2. Deploy example function
41+
42+
```
43+
tm deploy service node4-test -f https://github.com/serverless/examples --build-template aws-node4-runtime --build-argument DIRECTORY=aws-node-serve-dynamic-html-via-http-endpoint --build-argument HANDLER=handler.landingPage --wait
44+
```
45+
46+
3. Function is ready
47+
48+
```
49+
curl http://node43-test.default.dev.triggermesh.io
50+
51+
{"statusCode":200,"headers":{"Content-Type":"text/html"},"body":"\n <html>\n <style>\n h1 { color: #73757d; }\n </style>\n <body>\n <h1>Landing Page</h1>\n <p>Hey Unknown!</p>\n </body>\n </html>"}
52+
```
3153

3254
### Support
3355

node-10.x/buildtemplate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353
ENV _HANDLER "${HANDLER}"
5454
5555
COPY . .
56-
56+
RUN npm install
5757
ENTRYPOINT ["/opt/aws-custom-runtime"]
5858
EOF
5959
- name: export

node-4.x/buildtemplate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
- |
3939
cd /workspace/${DIRECTORY}
4040
cat <<EOF > Dockerfile
41-
FROM node:4.3
41+
FROM node:4-alpine
4242
WORKDIR /opt
4343
4444
RUN apk --no-cache add curl \
@@ -53,7 +53,7 @@ spec:
5353
ENV _HANDLER "${HANDLER}"
5454
5555
COPY . .
56-
56+
RUN npm install
5757
ENTRYPOINT ["/opt/aws-custom-runtime"]
5858
EOF
5959
- name: export

0 commit comments

Comments
 (0)