Skip to content

Commit 68c6d67

Browse files
author
Castro, Mario
committed
Address reviewer comments
1 parent 2da0642 commit 68c6d67

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/rocket-webhook-azure-infrastructure/src/functions/webhook-function.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ const { boosterRocketDispatcher } = require('./dist/index')
66
}
77

88
static generateFunctionsCode(endpoint: string): string {
9-
const name = endpoint.replace(/\//g, '_')
109
return `
11-
app.http('${name}', {
10+
app.http(${JSON.stringify(endpoint.replace(/[^a-zA-Z0-9_]/g, '_'))}, {
1211
methods: ['POST', 'GET'],
1312
authLevel: 'anonymous',
14-
route: '${endpoint}',
13+
route: ${JSON.stringify(endpoint)},
1514
handler: async (request, context) => {
1615
const headers = {}
1716
request.headers.forEach((value, key) => { headers[key] = value })
@@ -39,7 +38,6 @@ app.http('${name}', {
3938
}
4039
4140
const webhookRequest = {
42-
ROCKET_FUNCTION_ID: process.env.ROCKET_FUNCTION_ID,
4341
req: {
4442
method: request.method,
4543
url: request.url,

packages/rocket-webhook-azure-infrastructure/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { WebhookParams } from '@boostercloud/rocket-webhook-types'
66
const AzureWebhook = (params: WebhookParams): InfrastructureRocket => ({
77
mountStack: Synth.mountStack.bind(Synth, params),
88
mountFunctionsV4: Functions.mountFunctionsV4.bind(Functions, params),
9-
getFunctionAppName: Functions.getFunctionAppName.bind(Synth, params),
9+
getFunctionAppName: Functions.getFunctionAppName.bind(Functions, params),
1010
})
1111

1212
export default AzureWebhook

0 commit comments

Comments
 (0)