gruntjs/grunt-contrib-connect — pull request #16 by mcheely (2013-02-19 04:52:10+00:00)
Title: Allow middleware to be mapped to specific paths.

This updates the middleware option to allow middleware to be targeted to specific paths. For me it's a useful way to quickly host & hack on a browser js app locally & proxy some paths to the server API to dodge same origin policies. For example:

```js
connect: {
server: {
options: {
middleware: function (connect, options) {
return {
'/api': [proxy(url.parse('http://localhost:8080/api'))]
};
}
}
}
}
```
Would add the proxy middleware to the '/api' path, while leaving the default behavior of serving the current directory otherwise intact.