| 31 | }); |
| 32 | |
| 33 | export 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 |
| 40 | require("firebase-functions/lib/logger/compat"); |
| 41 | |
| 42 | const expressApp = require('./${path}/main').app(); |
| 43 | |
| 44 | exports.${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 | |
| 51 | export const functionGen2 = ( |
| 52 | path: string, |