-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing $return for httpTriggers for 0.9
- Loading branch information
Showing
3 changed files
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"direction": "in" | ||
}, | ||
{ | ||
"name": "$return", | ||
"name": "res", | ||
"type": "http", | ||
"direction": "out" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
{ | ||
"type": "http", | ||
"direction": "out", | ||
"name": "$return" | ||
"name": "res" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}; |