This is not currently supported, and it is not easy to add it yourself.
All routing information is buried deep inside the server code, and as a bonus there is no impact on the routes that they themselves.
I dug the source and also checked the latest version of Express and Connect middleware, but there is still no support for such features, you should open the problem either on Connect or Express .
In the same time...
Fix it yourself, here's a quick and easy way with changing just one line of code.
In ~/.local/lib/node/.npm/express/1.0.0/package/lib/express/servers.js do a search:
// Generate the route this.routes[method](path, fn);
This should be around line 357 , replace with:
// Generate the route this.routes[method](((self.settings.base || '') + path), fn);
Now just add a parameter:
app.set('base', '/myapp');
This works great with paths that are straight strings, for RegEx support you will have to hack into the middleware of the router yourself, otherwise it is better to indicate the problem.
As for the static provider, just add /mypapp when configuring.
Update
Did the job with RegExp too:
// replace this.routes[method](baseRoute(self.settings.base || '', path), fn); // helper function baseRoute(base, path) { if (path instanceof RegExp) { var exp = RegExp(path).toString().slice(1, -1); return new RegExp(exp[0] === '^' ? '^' + base + exp.substring(1) : base + exp); } else { return (base || '') + path; } }
I tested this with just a few expressions, so this is not 100% tested, but theoretically it should work.
Update 2
Patch issue filed:
https://github.com/visionmedia/express/issues/issue/478