| 49 | `; |
| 50 | |
| 51 | export 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 |
| 58 | require("firebase-functions/lib/logger/compat"); |
| 59 | |
| 60 | const expressApp = require('./${path}/main').app(); |
| 61 | |
| 62 | exports.${functionName || DEFAULT_FUNCTION_NAME} = onRequest(${JSON.stringify({ |
| 63 | region: options.region || DEFAULT_FUNCTION_REGION, |
| 64 | ...(options.functionsRuntimeOptions || DEFAULT_RUNTIME_OPTIONS) |
| 65 | })}, expressApp); |
| 66 | `; |
| 67 | |
| 68 | export const dockerfile = ( |
| 69 | options: DeployBuilderOptions, |