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

Function defaultFunction

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

Source from the content-addressed store, hash-verified

31});
32
33export const defaultFunction = (
34 path: string,
35 options: DeployBuilderOptions,
36 functionName: string|undefined,
37) => `const functions = require('firebase-functions');
38
39// Increase readability in Cloud Logging
40require("firebase-functions/lib/logger/compat");
41
42const expressApp = require('./${path}/main').app();
43
44exports.${functionName || DEFAULT_FUNCTION_NAME} = functions
45 .region('${options.region || DEFAULT_FUNCTION_REGION}')
46 .runWith(${JSON.stringify(options.functionsRuntimeOptions || DEFAULT_RUNTIME_OPTIONS)})
47 .https
48 .onRequest(expressApp);
49`;
50
51export const functionGen2 = (
52 path: string,

Callers 1

deployToFunctionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected