Skip to content

Commit fd32f38

Browse files
committed
chore: add comments to functions generation
1 parent 1445c26 commit fd32f38

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/runtime/src/helpers/functions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ export const generateFunctions = async (
4545
})
4646
const functionName = getFunctionNameForPage(route, config.type === ApiRouteType.BACKGROUND)
4747
await ensureDir(join(functionsDir, functionName))
48+
49+
// write main API handler file
4850
await writeFile(join(functionsDir, functionName, `${functionName}.js`), apiHandlerSource)
51+
52+
// copy handler dependencies (VercelNodeBridge, NetlifyNextServer, etc.)
4953
await copyFile(bridgeFile, join(functionsDir, functionName, 'bridge.js'))
5054
await copyFile(
5155
join(__dirname, '..', '..', 'lib', 'templates', 'server.js'),
@@ -69,7 +73,11 @@ export const generateFunctions = async (
6973
const writeHandler = async (functionName: string, isODB: boolean) => {
7074
const handlerSource = await getHandler({ isODB, publishDir, appDir: relative(functionDir, appDir) })
7175
await ensureDir(join(functionsDir, functionName))
76+
77+
// write main handler file (standard or ODB)
7278
await writeFile(join(functionsDir, functionName, `${functionName}.js`), handlerSource)
79+
80+
// copy handler dependencies (VercelNodeBridge, NetlifyNextServer, etc.)
7381
await copyFile(bridgeFile, join(functionsDir, functionName, 'bridge.js'))
7482
await copyFile(
7583
join(__dirname, '..', '..', 'lib', 'templates', 'server.js'),

0 commit comments

Comments
 (0)