Permalink
Browse files

v0.0.2

  • Loading branch information...
1 parent 202ca93 commit aed590556f955488bc0a63e57c643a5e53620774 @tarruda committed Aug 30, 2012
Showing with 8 additions and 8 deletions.
  1. +7 −7 README.md
  2. +1 −1 package.json
View
@@ -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,
View
@@ -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": {

0 comments on commit aed5905

Please sign in to comment.