0

I'm building my website ( http://tedxgramercy.jit.su ) with express.js and so far I've been using the http.request method in node to access couch, and that's been cool. I've learned lots about how http, couch, and node work, which is awesome. Anyways, I'm thinking of moving over to cradle now (Let me know if you have a strong opinion about this) and I'd like to know the "right" way to set this up.

Should I...

require() cradle and make a new connection to my db in each separate route?

create my database connection once, and then just pass that connection by require()ing the connection in each route? (if so, how do I do that?)

Thanks!!!

Costa Michailidis
  • 7,691
  • 15
  • 72
  • 124

1 Answers1

1

Given the options you should continue using request.

dscape
  • 2,506
  • 1
  • 22
  • 20
  • Feel free to propose other options. – Costa Michailidis Jun 17 '12 at 19:54
  • Sorry never saw your response. I would suggest `nano` (https://github.com/dscape), but then again I wrote it. Cradle is fairly unmaintained and it's quite annoying people use it, as they will never have a good open source experience with it. – dscape Jun 20 '12 at 23:11
  • Gotcha. I've seen nano as well. Nano is....I don't want to say it does less, but that's exactly what appeals to me. I'm also thinking about just using the request library. Thanks for reaching out! So with Nano what's the right way to set up couchdb "sessions"? I know how to do with with the couch jquery plugin, but I need to do it through my backend (express.js) – Costa Michailidis Jun 21 '12 at 03:53