5 minutes later ... All it takes is posting it on a public forum and you figure it out.
var staticHandler = createStaticHandler("web",
defaultDocument: "index.html",
serveFilesOutsidePath: true);
var proxy1 = proxyHandler('http://localhost:8000');
var proxy2= proxyHandler('http://localhost:9000');
app.setShelfHandler((req) {
print(req.url.path);
if (req.url.path.startsWith("p1")) {
return proxy1(req);
}
else if (req.url.path.startsWith("p2")) {
return proxy2(req);
}
return staticHandler(req);
});
app.setupConsoleLog(Level.INFO);
app.start();