Modjs
modjs.org has the rudiments of an apache module to handle server side javascript using SpiderMonkey.
SpiderMonkey APIs and a tutorial. Apache Module APIs and a tutorial.
Would like MIME support, a global request/response object (both MIME trees I think), SQLite and MySQL support, and File IO Support (if its not already there). Also should have support for including other javascript sources. mod_js has an example for includes and some of the request/apache stuff. SpiderMonkey has an example shell that shows some support for File objects I think.
Would be nice to have libGD and/or ImageMagick support (EXIF too, if possible), as well as some sort of curl library to get to other sites to do stuff.
Things we should have:
- Class for MIME objects and MIME headers.
- Object with server info (environment, log functionality)
- Object with request info (request string (full and broken up), incoming mime object, maybe cookies already broken up, etc.)
- Object with response info (outgoing mime object, print functionality, obstack stuff, way to set headers, etc)
- File class extensions, if needed
- Better include support (add to File)
- MySQL/SQLite classes and support (new classes probably needed here)
- system call support (put this on server)
- image manipulation support (new classes probably needed here)
- json support (maybe just some quick functions on the response (encode) /request (decode) ? or maybe better as a global)
- curl support (new class probably, using MIME stuff to send and receive, probably wrapped by request/response like objects.. maybe they should be classes, too.)
- Instead of bothering with curl, maybe just have a way to open a socket and read/write to it for now.
JS Class APIs:
- File (see File API)
- server object (see server API)
- TCPConnection
- DbConnection
- DbStatement (see DbConnection)
- ProcessConnection
- MimeHeader
- MimeEntity
- MailMessage
- HTTPRequest
- HTTPResponse
- global object (see global object extensions)
Things the module should do if it can:
- Cache compiled javascript code?
- Stay alive? Might already do this...
- Cached javascript context? Would this make sense?
- Cached session stuff? Do I really want/need this?