Skip to content

Commit 599ec43

Browse files
committed
chore: fix file name
1 parent 915ae64 commit 599ec43

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
declare function getUserTodos(auth: string | null): Promise<{ id: string }>;
2+
3+
import { Router } from '@aws-lambda-powertools/event-handler/experimental-rest';
4+
import type { Context } from 'aws-lambda';
5+
6+
const app = new Router({ prefix: '/todos' });
7+
8+
// matches POST /todos
9+
app.post('/', async ({ req: { headers } }) => {
10+
const todos = await getUserTodos(headers.get('Authorization'));
11+
return { todos };
12+
});
13+
14+
export const handler = async (event: unknown, context: Context) =>
15+
app.resolve(event, context);

0 commit comments

Comments
 (0)