MCPcopy Create free account
hub / github.com/vercel/vercel / checkEntrypoint

Function checkEntrypoint

packages/python/src/entrypoint.ts:153–161  ·  view source on GitHub ↗

* Check if a Python file contains a top-level app/handler. * Returns the matched variable name (e.g. "app"), or null if not found.

(
  workPath: string,
  relPath: string
)

Source from the content-addressed store, hash-verified

151 * Returns the matched variable name (e.g. "app"), or null if not found.
152 */
153async function checkEntrypoint(
154 workPath: string,
155 relPath: string
156): Promise<string | null> {
157 const absPath = join(workPath, relPath);
158 if (!(await fileExists(absPath))) return null;
159 const content = await fs.promises.readFile(absPath, 'utf-8');
160 return findAppOrHandler(content);
161}
162
163/**
164 * Recursively walk workPath collecting .py files, skipping hidden dirs,

Callers 1

detectPythonEntrypointFunction · 0.85

Calls 2

findAppOrHandlerFunction · 0.90
fileExistsFunction · 0.70

Tested by

no test coverage detected