Skip to content

Commit c4e4e7e

Browse files
committed
Use ES module for handler
1 parent 0e0ba8c commit c4e4e7e

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

handlers/package.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

handlers/todo.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
'use strict'
1+
import { todo } from '../index.js'
22

3-
const index = import('../index.js')
4-
5-
exports.handler = async () => {
6-
const { todo } = await index
3+
export default async () => {
74
return {
85
statusCode: 200,
96
body: JSON.stringify({

serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ package:
4949
functions:
5050
todo:
5151
url: true
52-
handler: handlers/todo.handler
52+
handler: handlers/todo.default

0 commit comments

Comments
 (0)