Skip to content

Commit 223990e

Browse files
committed
chore: add comment on route[0]
1 parent 88f9b3e commit 223990e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/runtime/src/helpers/functions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export const generateFunctions = async (
6363
const { functionName, routes, type, includedFiles } = apiLambda
6464

6565
const apiHandlerSource = getApiHandler({
66+
// most api lambdas serve multiple routes, but scheduled functions need to be in separate lambdas.
67+
// so routes[0] is safe to access.
6668
schedule: type === ApiRouteType.SCHEDULED ? routes[0].config.schedule : undefined,
6769
publishDir,
6870
appDir: relative(functionDir, appDir),

0 commit comments

Comments
 (0)