Assuming you are on Heroku and are limited to only Node.js apps, I would suggest you to start a new node instant as a reverse proxy. A quick and dirty example would be the following:
proxy.js
var http = require('http'),
httpProxy = require('http-proxy');
var options = {
pathnameOnly: true,
router: {
'/foo': '127.0.0.1:8001',
'/bar': '127.0.0.1:8002'
}
};
var proxyServer = httpProxy.createServer(options);
proxyServer.listen(8000);
first.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('I am the first server!\n');
}).listen(8001);
second.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('I am the second server!\n');
}).listen(8002);
start all three scripts using node, and the test result is as follows:
cloud@wishlist:~$ curl localhost:8000/foo
I am the first server!
cloud@wishlist:~$ curl localhost:8000/bar
I am the second server!
which is exactly what you need: something that makes it look like two apps are listening on the same port. For more detail, look into the node http-proxy module