start is exported from src/core.mjs.
interface Options {
port?: string;
mode?: 'git' | 'npm' | 'url' | 'local';
gitCloneUrl?: string;
gitUsername?: string;
gitToken?: string;
npmTar?: string;
urlTar?: string;
startScript?: string;
functionsConfig?: {
functionsDirPath: string | string[];
assets?: string;
bfastJsonPath?: string;
};
}If functionsConfig.functionsDirPath is provided, local functions are used directly and remote pull modes are skipped.
That means mode is effectively ignored when local directory paths are configured.
When local paths are not provided:
mode: 'git'requiresgitCloneUrl(optionalgitUsername/gitTokenfor private repos)mode: 'npm'requiresnpmTarmode: 'url'requiresurlTar
Invalid/missing required values lead to process exit with an error message.
If startScript is a non-empty string, runtime executes it instead of starting the built-in HTTP server.
Execution directory:
- local functions dir (if provided), else internal runtime function folder.
stop() attempts graceful shutdown and then exits process.