Id like to dynamically create subdomains for different proxies, like so:
var app = require('express')();
var proxy = require('express-http-proxy');
var vhost = require('vhost');
app.get('/make', function (req, res) {
app.use(vhost('sub1.mysite.com', proxy("www.example.com")));
});
app.listen(8080);
What's the best way to accomplish this? The problem seems to be calling app.use() after the server is created.