Skip to content

Commit

Permalink
v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tarruda committed Aug 30, 2012
1 parent 202ca93 commit aed5905
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ router.get('/get/<uuid:id>', function(req, res) {
in Flask/Werkzeug):

```js
router.registerParser('options', function(str) {
router.registerParser('query', function(str) {
var rv = {};
, options = str.split('/')
, queryParams = str.split('/')
, i, len, kv, key, value;
for (i = 0, len = options.length; i < len; i++) {
option = options[i];
kv = option.split('=');
for (i = 0, len = queryParams.length; i < len; i++) {
param = queryParams[i];
kv = param.split('=');
key = kv[0], value = kv[1];
rv[key] = value;
}
return rv;
});

router.get('/queryable/<options:query>', function(req, res) {
console.log(JSON.stringify(req.params.query));
router.get('/queryable/<query:q>', function(req, res) {
console.log(JSON.stringify(req.params.q));
res.end();
});
// If '/queryable/gt=5/lt=10/limit=20' was requested,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Thiago de Arruda <tpadilha84@gmail.com>",
"name": "flask-router",
"version": "0.0.1",
"version": "0.0.2",
"description": "Flask-inspired routing system for node and connect.\nNice if you just need a routing system without depending on connect, or need routing middleware without all features provided by express.",
"main": "./lib/router.js",
"repository": {
Expand Down

0 comments on commit aed5905

Please sign in to comment.