Sat, 14 Apr 07

Small, specific mongrel web servers

I’ve created a simple mongrel server that allows you to upload text files for subsequent deletion and retrieval. If it sounds pretty pointless, that’s because it is…currently. I wonder though, if the basic premise couldn’t be used to create some text-transformation tools. I’m thinking of really simple tools that might spell-check a text file, or convert text from textile to html. My end goal would be to have lots of super simple tools that I can chain together to use as a blogging platform, removing my current dependence on typo.

I’ve made the server slightly more complex than it needs to be by imposing some artificial constraints (examples). The basic premise is that you post a text file, between 1 and 5000 bytes in size, with a content-type of plain/text. All being well, the server responds with 201 Created and the location of the new resource. The resource is actually retrieved by deleting it – the contents of the file are returned in the body with a “200 OK” response. I’ve tried to use the relevant HTTP error when resource creation fails. The whole ‘post’ and ‘delete’ pattern for these transformations feels kinda restful, but I may be way off the mark.

I’m wondering how much of yahoo pipes could be replicated with lots of small, specific web servers.

Anyone have any thoughts on any of this?