Skip to content
Myr

Merge pull request #1006 from eivindfjeldstad/router

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Added support for arrays of paths

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents 6518e74, 38b046d · Browse files · 2 files+21 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+21 added−3 removed

  • tests:+18 added−1 removed
  • other:+3 added−2 removed

2 files+21 added−3 removed

modified:lib/router/route.js+3 added-2 removed
modified:test/app.router.js+18 added-1 removed
11var express = require('../')2 , request = require('./support/http')3 , assert = require('assert');4
103 unmodified lines
108 .get('/user/10/edit')109 .expect('editing user 10', done);110 })111 })112 113 describe('when given an array', function(){114 it('should match all paths in the array', function(done){115 var app = express();116 117 app.get(['/one', '/two'], function(req, res){118 res.end('works');119 });120 121 request(app)122 .get('/one')123 .expect('works', function() {124 request(app)125 .get('/two')126 .expect('works', done);127 });128 })129 })130131 describe('case sensitivity', function(){132 it('should be disabled by default', function(done){133 var app = express();
393 unmodified lines