Permalink
Browse files

Update READMEs with HTTP information

  • Loading branch information...
1 parent fd56ab8 commit d780392a1a3743979505a229b16ea63c11fc1ad7 @tombell tombell committed Jan 12, 2012
Showing with 34 additions and 0 deletions.
  1. +17 −0 README.md
  2. +17 −0 src/templates/README.md
View
@@ -49,6 +49,23 @@ individual scripts.
[hubot-scripts]: https://github.com/github/hubot-scripts
[hubot-scripts-readme]: https://github.com/github/hubot-scripts#readme
+## HTTP Listener
+
+Hubot has a HTTP listener which listens on the port specified by the `PORT`
+environment variable.
+
+You can specify routes to listen on in your scripts by using the `router`
+property on `robot`.
+
+```coffeescript
+module.exports = (robot) ->
+ robot.router.get "/hubot/version", (req, res) ->
+ res.end robot.version
+```
+
+There are functions for GET, POST, PUT and DELETE, which all take a route and
+callback function that accepts a request and a response.
+
## Testing hubot locally
Install all of the required dependencies by running `npm install`.
View
@@ -13,6 +13,23 @@ those dependencies are provided by [npm][npmjs].
[npmjs]: http://npmjs.org
+## HTTP Listener
+
+Hubot has a HTTP listener which listens on the port specified by the `PORT`
+environment variable.
+
+You can specify routes to listen on in your scripts by using the `router`
+property on `robot`.
+
+```coffeescript
+module.exports = (robot) ->
+ robot.router.get "/hubot/version", (req, res) ->
+ res.end robot.version
+```
+
+There are functions for GET, POST, PUT and DELETE, which all take a route and
+callback function that accepts a request and a response.
+
### Redis
If you are going to use the `redis-brain.coffee` script from `hubot-scripts`

0 comments on commit d780392

Please sign in to comment.