What? Are you mad?
Yes, we quite probably are. But not as mad as some people.
mod_js is a standalone module for Apache (
In its current form it is just a very simple proof of concept. Consider the following example:
// Populates params variable from request.env.QUERY_STRING include('/Users/tomi/Sites/scripts/util.js'); print("<html><head>"); print("<title>Page title here</title>"); print("</head>"); print("<body>"); print("<pre>"); tree( params, "params"); print("</pre>"); // You can print E4X objects print(<form method="get"> <input name="value" /> <input type="submit" /> </form>); print("<pre>\n"); tree( this, "this" ); print("</body></html>");
If you have ever used perl’s CGI.pm, this might look familiar to you. As it should - it’s loosely what we based the interface on.
If you really want to look at how we did it, you can look at the subversion server. To try it out yourself:
svn co http://www.modjs.org/svn/trunk/mod_js autoconf ./configure make sudo make install
(Until the code is in a situation to actually be useful, there wont be a dist available, and as such you will need autoconf.)
The code for mod_js is dual licenced under GPLv3 and Apache License 2.0.
Ash Berlin and Tom Insam wrote mod_js as a simple proof of concept during one of
Fotango’s hack days. Our thanks go out to Fotango for being enlightened enough to let us have hack days, and to release this. Thanks.