MCPcopy
hub / github.com/angular/angularfire / functionGen2

Function functionGen2

src/schematics/deploy/functions-templates.ts:51–66  ·  view source on GitHub ↗
(
  path: string,
  options: DeployBuilderOptions,
  functionName: string|undefined,
)

Source from the content-addressed store, hash-verified

49`;
50
51export const functionGen2 = (
52 path: string,
53 options: DeployBuilderOptions,
54 functionName: string|undefined,
55) => `const { onRequest } = require('firebase-functions/v2/https');
56
57// Increase readability in Cloud Logging
58require("firebase-functions/lib/logger/compat");
59
60const expressApp = require('./${path}/main').app();
61
62exports.${functionName || DEFAULT_FUNCTION_NAME} = onRequest(${JSON.stringify({
63 region: options.region || DEFAULT_FUNCTION_REGION,
64 ...(options.functionsRuntimeOptions || DEFAULT_RUNTIME_OPTIONS)
65})}, expressApp);
66`;
67
68export const dockerfile = (
69 options: DeployBuilderOptions,

Callers 1

deployToFunctionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected