File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
packages/rocket-webhook-azure-infrastructure/src/functions Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ export class Functions {
1616 _utils : RocketUtils
1717 ) : Promise < FunctionAppV4Definitions > {
1818 const functionAppName = getFunctionAppName ( applicationSynthStack . resourceGroupName )
19- const functionsCode = params . map ( ( param ) => WebhookFunction . generateFunctionsCode ( getRoute ( param ) ) ) . join ( '\n' )
19+ const registrations = params . map ( ( param ) => WebhookFunction . generateFunctionsCode ( getRoute ( param ) ) ) . join ( '\n' )
20+ const functionsCode = WebhookFunction . sharedImports ( ) + registrations
2021 return [ { functionAppName, functionsCode } ]
2122 }
2223
Original file line number Diff line number Diff line change 11export class WebhookFunction {
2+ static sharedImports ( ) : string {
3+ return `const { app } = require('@azure/functions')
4+ const { boosterRocketDispatcher } = require('./dist/index')
5+ `
6+ }
7+
28 static generateFunctionsCode ( endpoint : string ) : string {
39 const name = endpoint . replace ( / \/ / g, '_' )
410 return `
You can’t perform that action at this time.
0 commit comments