Skip to content

Commit

Permalink
added wildcard at ?
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilson committed Apr 30, 2012
1 parent 937e17a commit d7ffefb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion index.js
@@ -1,7 +1,6 @@
var pin = require('linchpin'),
url = require('url'),
http = require('http'),
// https = require('https'),
parseBody = require('./lib/parse'),
setResource = require('./lib/resource'),
mime = require('./lib/mime'),
Expand Down Expand Up @@ -49,6 +48,10 @@ function Apprentice() {
pin.emit(route, req, res);
});
});

self.start = function(port, cb) {
self.httpServer.listen(port, cb);
}

return self;
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -2,15 +2,15 @@
"author": "Tom Wilson <tom@jackhq.com>",
"name": "apprentice",
"description": "[Experimental] web library that adds some sugar to routing",
"version": "0.2.6",
"version": "0.2.7",
"repository": {
"url": ""
},
"engines": {
"node": "0.6 || 0.7"
},
"dependencies": {
"linchpin": "0.2.0",
"linchpin": "0.2.1",
"qs": "~0.4.2"
},
"devDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions readme.md
Expand Up @@ -63,3 +63,15 @@ res.html is a shortcut to send a html document to the caller.
``` javascript
pin.on('GET', function(req, res) {res.html "<h1>Hello World</h1>");});
```

## FAQ

### How do I manage static assets

You can use filed:

``` javascript
pin.on('GET/favicon.ico', function(req, res) { filed("#{__dirname}/../assets/favicon.ico").pipe(res); });
pin.on 'GET/assets/*/*', function(req, res) { filed("#{__dirname}/../#{req.url}").pipe(res); });
```

0 comments on commit d7ffefb

Please sign in to comment.