diff --git a/Templates/HttpTrigger-CSharp/function.json b/Templates/HttpTrigger-CSharp/function.json index 4811cddd9..8a66e70ea 100644 --- a/Templates/HttpTrigger-CSharp/function.json +++ b/Templates/HttpTrigger-CSharp/function.json @@ -8,7 +8,7 @@ "direction": "in" }, { - "name": "$return", + "name": "res", "type": "http", "direction": "out" } diff --git a/Templates/HttpTrigger-JavaScript/function.json b/Templates/HttpTrigger-JavaScript/function.json index ed2faaa80..889e5ebf6 100644 --- a/Templates/HttpTrigger-JavaScript/function.json +++ b/Templates/HttpTrigger-JavaScript/function.json @@ -10,7 +10,7 @@ { "type": "http", "direction": "out", - "name": "$return" + "name": "res" } ] } \ No newline at end of file diff --git a/Templates/HttpTrigger-JavaScript/index.js b/Templates/HttpTrigger-JavaScript/index.js index c4103d1b7..f65a277b7 100644 --- a/Templates/HttpTrigger-JavaScript/index.js +++ b/Templates/HttpTrigger-JavaScript/index.js @@ -1,17 +1,17 @@ -module.exports = function (context, req) { +module.exports = function(context, req) { context.log('JavaScript HTTP trigger function processed a request.'); if (req.query.name || (req.body && req.body.name)) { - res = { + context.res = { // status: 200, /* Defaults to 200 */ body: "Hello " + (req.query.name || req.body.name) }; } else { - res = { + context.res = { status: 400, body: "Please pass a name on the query string or in the request body" }; } - context.done(null, res); + context.done(); }; \ No newline at end of file