Skip to content

Commit 87956eb

Browse files
committed
fix
1 parent d494624 commit 87956eb

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

articles/azure-functions/functions-bindings-sendgrid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ module.exports = function (context, input) {
197197
}]
198198
};
199199

200-
context.bindings.message = message;
200+
context.bindings = message;
201201
};
202202
```
203203

articles/azure-functions/functions-reference-node.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ When exporting an async function, you can also configure an output binding to ta
7777
If your function is synchronous (doesn't return a Promise), you must pass the `context` object, as calling `context.done` is required for correct use.
7878

7979
```javascript
80-
// You should include context, other arguments are optional
81-
module.exports = async function(context, myTrigger, myInput, myOtherInput) {
80+
// You should include `context`
81+
// Other arguments like `myTrigger` are optional
82+
module.exports = function(context, myTrigger, myInput, myOtherInput) {
8283
// function logic goes here :)
8384
context.done();
8485
};
@@ -273,15 +274,17 @@ module.exports = async function (context, req) {
273274
The **context.done** method is used by 1.x synchronous functions. In 2.x, 3.x, and 4.x, the function should be marked as async even if there is no awaited function call inside the function, and the function doesn't need to call context.done to indicate the end of the function.
274275

275276
```javascript
276-
// 1.x Synchronous code only
277-
// Even though we set myOutput to have:
278-
// -> text: 'hello world', number: 123
279-
context.bindings.myOutput = { text: 'hello world', number: 123 };
280-
281-
// If we pass an object to the done function...
282-
context.done(null, { myOutput: { text: 'hello there, world', noNumber: true }});
283-
// the done method overwrites the myOutput binding to be:
284-
// -> text: 'hello there, world', noNumber: true
277+
module.exports = function (context, req) {
278+
// 1.x Synchronous code only
279+
// Even though we set myOutput to have:
280+
// -> text: 'hello world', number: 123
281+
context.bindings.myOutput = { text: 'hello world', number: 123 };
282+
283+
// If we pass an object to the done function...
284+
context.done(null, { myOutput: { text: 'hello there, world', noNumber: true }});
285+
// the done method overwrites the myOutput binding to be:
286+
// -> text: 'hello there, world', noNumber: true
287+
}
285288
```
286289

287290

@@ -560,6 +563,7 @@ module.exports = async function(context) {
560563
// Using our imported underscore.js library
561564
const matched_names = _
562565
.where(context.bindings.myInput.names, {first: 'Carla'});
566+
}
563567
```
564568

565569
> [!NOTE]

0 commit comments

Comments
 (0)