mape / connect-assetmanager

Middleware for Connect (node.js) for handling your static assets.
MIT License
310 stars 48 forks source link

group.route within assetManager function not RegExp #22

Open danielschwartz opened 13 years ago

danielschwartz commented 13 years ago

In 0.0.24 there is a bug where unless you instantiate your regular express string as a RegExp object, the

if(group.route.test(req.url))

within the settings.forEach loop will error out stating that group.route does not have a method test. You can currently get around this by instantiating your regex as a RegExp object in the config by doing new RegExp(your regex string).

Either it should be instantiated by the plugin as a RegExp object or the example should be changed to show that you must instantiate it yourself.