Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
\`now-micro builder expects main export to be a function (\${typeof module.exports} found)\`,
)
}
exports = module.exports = (req, res) => require('micro').run(req, res, __original_lambda)
`
const fileDir = pathJoin(workPath, dirname(entrypoint).replace(__dirname, ''))
const filePath = pathJoin(fileDir, basename(entrypoint))
await ensureDirSync(fileDir, { recursive: true })
await writeFileSync(filePath, content)
// override entrypoint file
context.files[entrypoint] = new FileFsRef({ fsPath: filePath })
// delegate to @now/node the rest of the building process
return nodeBuild(context, ...args)
}