@befaas/lib
Advanced tools
Comparing version 8.18.2 to 8.19.0
@@ -1,6 +0,12 @@ | ||
## 8.18.2 (2022-05-09) | ||
## 8.19.0 (2022-05-19) | ||
#### Feature | ||
* change azureHandler (azure-function-express does only support http trigger) (1a0c77cd) | ||
#### Bug Fixes | ||
* undefined options (f432017f) | ||
* typo (6cef6330) | ||
* typo (025693ca) | ||
* handler definition, forward payload to app function only (019a3fa8) | ||
@@ -50,3 +50,3 @@ { | ||
}, | ||
"version": "8.18.2" | ||
"version": "8.19.0" | ||
} |
@@ -207,9 +207,21 @@ const _ = require('lodash') | ||
}, | ||
azureHandler: azure.createHandler(async (event, ctx) => { | ||
console.log("Event: " + JSON.safeStringify(event)) | ||
console.log("Ctx: " + JSON.safeStringify(ctx)) | ||
await handler(event, ctx) | ||
}), | ||
azureHandler: async (ctx, event) => { | ||
console.log("azureHandler called."); | ||
console.log("Subject: " + event.subject); | ||
console.log("Time: " + event.eventTime); | ||
console.log("Data: " + JSON.stringify(event.data)); | ||
const contextId = event.data.contextId || helper.generateRandomID() | ||
const xPair = event.data.xPair || 'undefined-x-pair' | ||
ctx.contextId = contextId | ||
ctx.xPair = xPair | ||
ctx.lib = createContext(contextId, xPair, dbBindToMeasure) | ||
const end = ctx.lib.measure(`msg`) | ||
await handler(event.data.event, ctx) | ||
end() | ||
}, | ||
tinyfaasHandler: _.isUndefined(handler) ? serverlessRouter(r => r.addRpcHandler(options)).tinyfaasHandler : serverlessRouter(options, r => r.addRpcHandler(handler)).tinyfaasHandler, | ||
} | ||
} |
55112858
503