Skip to content

Commit 1b77368

Browse files
committedOct 9, 2024
enhance: updated index example
1 parent 40a8380 commit 1b77368

File tree

6 files changed

+9
-3632
lines changed

6 files changed

+9
-3632
lines changed
 

‎Dockerfile

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
FROM public.ecr.aws/w9j2a6e3/nodejs:latest
1+
FROM public.ecr.aws/lambda/nodejs:20
22

3-
WORKDIR /usr/src/app
4-
5-
# COPY . .
63
COPY . ${LAMBDA_TASK_ROOT}
74

85
RUN npm i
96

10-
# EXPOSE 8080
11-
12-
USER node
13-
14-
# CMD ["node", "index.js"]
15-
16-
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
17-
CMD [ "index.js" ]
7+
# Set the CMD to your handler
8+
CMD [ "index.handler" ]

‎index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const handler = async (event) => {
1+
exports.handler = async (event) => {
22
const users = [
33
{ id: 1, name: 'John Doe', email: 'john.doe@example.com' },
44
{ id: 2, name: 'Jane Smith', email: 'jane.smith@example.com' },
@@ -12,5 +12,3 @@ const handler = async (event) => {
1212

1313
return response;
1414
};
15-
16-
module.exports = handler;

0 commit comments

Comments
 (0)
Please sign in to comment.