News for hackers. Stuff that matters.
Re:Why node.js disappoints me by kls on Monday September 27, 2010 @12:36PM (#1732247)
Thanks for the reply, my next project is going to be doing the REST services with Node. I have been using Java for my services because until Node I really did not see a big enough reason to move platforms. What are you using for your REST services implementation, a Node library or did you roll your own? I did not know about Paperboy so thanks for pointing me to that project.
Re:Why node.js disappoints me by pilif on Monday September 27, 2010 @01:33PM (#1732460)
in this case, the API was so simple, I could easily roll my own (it's not even a real framework - I have one resource, the alias and I allow basically just POST to /aliases to create one at the moment).

The beauty about node is that it's so simple to extend and add the functionality you need. No magic, no huge framework to learn.

The little things you get though work awesomely well and are a pleasure to use.

Re:Why node.js disappoints me by kls on Monday September 27, 2010 @01:48PM (#1732538)
If you could find the time to shot me an email (possible with some samples, or some links) of how you did your REST services with Node, I would be forever in your debt. My email is in my profile if you get a chance.
Re:Why node.js disappoints me by pilif on Monday September 27, 2010 @05:17PM (#1733465)
if it wasn't a bit ugly (organically grown, just one endpoint), I'd direct you to the source code of the tempalias HTTP server.

You can still have a look at it. As I said though, it's really ugly and I should really split it up into multiple files, factor out the common stuff and make the whole thing more clear.

Still. Here goes:

http://github.com/pilif/tempalias/blob/master/lib/tempalias_...

Lines 30 and following handle calls to /aliases (in my case, that's just a POST to /aliases to create an alias - later I'd add PUT to /aliases/<id> to update it and DELETE /aliases/<id> to delete it - assuming that a correct update key (part of the response to creation) has been created.

As I said: Butt-ugly code. Don't do it like this - factor out common stuff, create smaller functions for the various parts of the needed setup.

Re:Why node.js disappoints me by kls on Tuesday September 28, 2010 @08:26AM (#1735429)
Thanks don't worry about the ugly. We all have pieces we are not proud off. I would just like to see the basic of what you did so I have a head start when I jump into Node.

I can give you this, it is prettier than any code I have written in Node (if it is not apparent from my posts, I have not worked in Node).

Re:Why node.js disappoints me by percept on Monday September 27, 2010 @03:10PM (#1732936)
Post it here! Or someplace we can access, if it's useful.