At my day job I develop sites using a proprietary JSP framework which in turn runs on Apache Tomcat, sites are developed locally before being pushed via SVN to a staging site and then finally live. Tomcat has it’s own virtual host manager that runs in the browser, it’s a clever way of doing things but it it requires each and every site to be manually set up using a form each time you want to run it.
I can’t stand such inefficiency and after reading about how easy Chrome plugins are to develop I thought I’d give it a go and write a tool for myself. I love writing tools, I must have a script, shortcut, plugin or bookmarklet for just about everything nowadays and this one turned out to be one of the most useful ones I’ve created.
The idea is simple, the plugin needs to keep track of all the local sites I need access to (currently around 30+) and enable me to quickly see which ones are running as well as start, stop and restart them. All those actions are normally run using forms within Tomcats virtual host manager so all I need to do is spoof the form actions with AJAX calls.
The image above show the main options page, you might recognise the use of Twitter Bootstrap which helped speed up development so much. The full domain, aliases and file path are dynamically using a base configuration as seen below.
Sites can be added using a modal form (thanks to bootstrap), here you enter the sites domain, root path and any aliases, auto completion helps speed things up so it takes about 2 seconds to finish
The plugins popup UI is the more often used part, it enables starting a site running, stopping or restarting a running site and opening the site url in a new tab. If you can play it, the short video below shows the different states.
Currently this is just a tool used by me and a few colleagues but if anyone thinks it might be useful to them, I’ll stick it up on github.