From: "ara.t.howard" Date: 2007-08-03T12:07:03+09:00 Subject: Re: Easy REST server w/o views or controllers? On Aug 1, 2007, at 2:06 PM, Luke Kanies wrote: > Hi all, > > I'm in the processing of refactoring Puppet[1]'s networking, which > currently uses xmlrpc over https but I'm moving to REST, and I'm > hoping to be able to rely largely on existing code for the new work. > > The weird situation with Puppet is that I'm only interested in > computer-computer communication and in most cases have no interest > in multiple forms of a given object, so I don't think I need views, > and I'm not using a db backend, which means I don't need an ORM > like ActiveRecord. Basically, I just need the controllers and > routing, I think. > > I've looked around at most of the frameworks I can find, including > Nitro, Merb, Camping, and Rails, and all of them seem to assume > that I care deeply about databases and HTML, while really all I > want to do is make it easy to provide a REST-like interface for my > software to use to talk to itself. > > I plan on using ActiveResource[2] for the clients, and I'd love > something that was just as easy but handled the server side for > me. I've got 9 different namespaces in xmlrpc right now, but I > want it to be easy to add new controller types, of course. > > One of my biggest concerns with whatever I use is that it be easy > to distribute, since Puppet runs on all popular platforms (e.g., os > x, debian, ubuntu, rhel, fedora, solaris, freebsd) and is available > as a native package in most cases. I don't want people packaging > puppet to also have to package 10 other prerequisites, so I don't > want to rely on something that brings in 50 libraries to handle > views or models that I won't use. > > Anyone have any experience writing something like this? Can anyone > point me to an easy server-side REST api creator, something with > few dependencies and that focuses on the routing? There are some > things I've been told are in Rails that I'd also like, like content- > type negotiation and automatic serialization and deserialization, > since I'm sometimes passing YAML around (although often just plain > text). > > Thanks, > Luke hey luke - how goes? we are just starting a project that's going to use extjs for the entire front-end http://extjs.com/ and my plan is to do only controllers for the backend : basically 'json_output remote_method(json_input)' rpc style interaction. all business logic will be exposed as ajax methods taking json in and rendering json. not quite up your alley, but maybe we can compare notes... also, at some point in the past, i made a small plugin that allowed any rails model to be fully rest-able via xml or yaml... i'll try to dig it up... a @ http://drawohara.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama