In my test servers for Perl Dancer, I can deploy an almost infinite set of versions of the code and have Apache automatically start the FCGI applications and close them as necessary.

Goto root (http://test.../) and I get a list of the installed versions (directories really) then if I click on the directory I see a list of applications (again really directories) this time however they are fast cgi apps - click on those and I have a running Dacner instance - slow to start first time, then ok.

Relative paths for all my code and everything works like a charm.

Now with NodeJS each application requires a dedicated server and port. Even using Fastcgi the Node applications are started and use sockets.

Using node http-proxy it should be possible to achieve the same as above. Generate a directory list of versions. For each version a directory list of applications. Click on an application and execute a Node Instance - even have them shut down with no activity for an hour.

  • Testing, pre-alpha server only - not considering security here.
  • http-proxy has a top level directory
  • Top directory is simply a list of directories, presented as HTML view
  • Any directory can contain a known config file - e.g. node-proxy.json which describes how to execute the NODE server, or possibly any other service to pass through (e.g. Other URL, even external, CGI, FastCGI, Static files).

There are other ways to switch versions. How about a cookie. http-proxy can choose the version to execute based on a cookie, allowing you to use absolute urls/paths.

Have a special path - /use/ - or similar where you can see the list of versions and change your cookie.