Skip to content
Browse files

fix route regexp example

  • Loading branch information...
1 parent 76d9146 commit 64faa1feae6bef47ba6593305aa68661e56b804a @tj tj committed
Showing with 2 additions and 2 deletions.
  1. +1 −1 api.html
  2. +1 −1 en/api/app-VERB.jade
View
2 api.html
@@ -218,7 +218,7 @@
</code></pre><p>Regular expressions may also be used, and can be useful
if you have very specific restraints, for example the following
would match "GET /commits/71dbb9c" as well as "GET /commits/71dbb9c..4c084f9".
-</p><pre class="js"><code>app.get(/^\/commits\/(\d+)(?:\.\.(\d+))?$/, function(req, res){
+</p><pre class="js"><code>app.get(/^\/commits\/(\w+)(?:\.\.(\w+))?$/, function(req, res){
var from = req.params[0];
var to = req.params[1] || 'HEAD';
res.send('commit range ' + from + '..' + to);
View
2 en/api/app-VERB.jade
@@ -28,7 +28,7 @@ section
would match "GET /commits/71dbb9c" as well as "GET /commits/71dbb9c..4c084f9".
+js.
- app.get(/^\/commits\/(\d+)(?:\.\.(\d+))?$/, function(req, res){
+ app.get(/^\/commits\/(\w+)(?:\.\.(\w+))?$/, function(req, res){
var from = req.params[0];
var to = req.params[1] || 'HEAD';
res.send('commit range ' + from + '..' + to);

0 comments on commit 64faa1f

Please sign in to comment.
Something went wrong with that request. Please try again.