Skip to content

Commit

Permalink
Merge pull request hubotio#695 from dblandin/http-listener-response-doc
Browse files Browse the repository at this point in the history
Add documentation on sending back a response within an HTTP listener
  • Loading branch information
technicalpickles committed May 19, 2014
2 parents 04b97ea + 9c62971 commit e8f080f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,13 @@ The most common use of this is for providing HTTP end points for services with w
```coffeescript
module.exports = (robot) ->
robot.router.post '/hubot/chatsecrets/:room', (req, res) ->
room = req.params.room
data = JSON.parse req.body.payload
room = req.params.room
data = JSON.parse req.body.payload
secret = data.secret

robot.messageRoom room, "I have a secret: #{secret}"

res.send 'OK'
```

## Events
Expand Down

0 comments on commit e8f080f

Please sign in to comment.