Permalink
Browse files

add docs for public API

  • Loading branch information...
1 parent e6365a8 commit 46109e6473d267e470b365ce7e6365089b592932 @tj tj committed Jul 4, 2012
Showing with 15 additions and 1 deletion.
  1. +13 −0 Readme.md
  2. +1 −0 examples/simple.js
  3. +1 −1 lib/send.js
View
@@ -59,6 +59,19 @@ var app = http.createServer(function(req, res){
- `stream` file streaming has started `(stream)`
- `end` streaming has completed
+### .root(dir)
+
+ Serve files relative to `path`. Aliased as `.from(dir)`.
+
+### .index(path)
+
+ By default send supports "index.html" files, to disable this
+ invoke `.index(false)` or to supply a new index pass a string.
+
+### .maxage(ms)
+
+ Provide a max-age in milliseconds for http caching, defaults to 0.
+
## Error-handling
By default when no `error` listeners are present an automatic response will be made, otherwise you have full control over the response, aka you may show a 5xx page etc.
View
@@ -9,5 +9,6 @@ var send = require('..')
http.createServer(function(req, res){
send(req.url)
.from(__dirname + '/public')
+ .maxage(60000)
.pipe(res);
}).listen(3000);
View
@@ -430,7 +430,7 @@ SendStream.prototype.stream = function(path, options){
* if it hasn't been explicitly set.
*
* @param {String} path
- * @api public
+ * @api private
*/
SendStream.prototype.type = function(path){

0 comments on commit 46109e6

Please sign in to comment.