wictorwilen / express-msteams-host

Express utility for Microsoft Teams solutions
MIT License
13 stars 6 forks source link

Use arrow function to call 'requestHandler' to preserve the 'this' context. #2

Closed LaurenceMommers closed 4 years ago

LaurenceMommers commented 4 years ago

This fixes an issue where the function passed to router.post is no longer aware of the this context. and this inside the requestHandler function will be undefined.

Indirectly related to this: https://stackoverflow.com/questions/34680450/this-is-undefined-in-expressjs-route-handler.