Hi Justin, Have a look at the LoopBack source code <https://github.com/strongloop/loopback> for a good example of a larger project setup. As for REST APIs, this is the perfect use case for actually using LoopBack. You can simply create your models with a few commands <http://docs.strongloop.com/display/LB/Getting+started+with+LoopBack> and the standard CRUD (create, read, update, delete) REST API endpoints will be created automatically. Of course it does that and a whole lot more, see the documentation <http://docs.strongloop.com/display/LB/LoopBack> for more information.
Cheers, Simon On Monday, 15 December 2014 14:15:09 UTC-8, Justin Maat wrote: > > Awesome thanks!!! > > Yes, this is basically the same general concept I'm trying to achieve. > Didn't even know this project existed :) > > > > On Monday, 15 December 2014 15:30:22 UTC-5, Adrien Risser wrote: >> >> I suggest you take a look at Google API node module, it's basically what >> you are trying to achieve. >> >> -- >> Adrien Risser, >> Node.js Consultant >> +33 6 59 60 32 58 >> On Dec 15, 2014 9:25 PM, "Justin Maat" <jxm...@gmail.com> wrote: >> >>> Thank you kindly. This at least helps get me started. Yeah, I know >>> it's kind of asking for an opinionated answer, but it helps me when I >>> review existing code instead of googling for random snippets across the >>> internet. >>> >>> I'll start with the actual node codebase and move from there. >>> >>> >>> >>> On Monday, 15 December 2014 12:51:28 UTC-5, Floby wrote: >>>> >>>> Hello, >>>> >>>> my advice on the matter of "good coding style" and "best practices" are >>>> that these are similar to bandwagons. The smarter thing to do would be to >>>> try and gain some understanding of the existing practices and where they >>>> come from. >>>> >>>> that said : >>>> - the node.js codebase itself has a pretty straighforward coding style >>>> - express has had a lot of contributors and does some pretty clever >>>> stuff >>>> - I don't like request's coding style and particularily not how it's >>>> just one big file >>>> - any of substack's module is a good place to start as they are usually >>>> small and easy to wrap your head around >>>> - nodejitsu/flatiron codebases are pretty well done in my opinion, very >>>> organised >>>> - strongloop code should be ok to look at as well >>>> >>>> >>>> >>>> On Saturday, 13 December 2014 00:03:02 UTC+1, Justin Maat wrote: >>>>> >>>>> Apologies since I know this is sort of a broad question, but I'm >>>>> fairly new with Node and trying to wrap my helload around some best >>>>> practices. I come from a java/scala background and while learning a new >>>>> language, I typically like to look at existing libraries to get some >>>>> knowledge and understanding. >>>>> >>>>> My goal - I'm trying to make a npm module that will aggregate a bunch >>>>> of different (but functionally related) rest api's then expose them with >>>>> some common wrapper functions. >>>>> >>>>> For example - http://domain1/some_endpoint/.. , >>>>> http://domain2/some_other_endpoint,.. etc. Where the endpoints >>>>> (some_endpoint and other_endpoint) do functionally similar things >>>>> >>>>> Where my module will allow something like >>>>> >>>>> var myapp = require('myapp.js'); >>>>> var Domain1 = myapp.domain1; >>>>> var Domain2 = myapp.domain2; >>>>> >>>>> >>>>> Domain1.endpoint(args); //or something to this effect >>>>> Domain2.endpoint(args); >>>>> >>>>> >>>>> My question is, what are some open source resources that are >>>>> considered "good" that I can review for best practices on how to >>>>> structure >>>>> the app? So far, I've looked through the request, async, and q libraries >>>>> to try and find some inspiration but there seems to be a huge difference >>>>> in >>>>> coding styles between alot of these open source projects. >>>>> >>>>> >>>>> So.. I guess my question can be generalized as - what are some good >>>>> open source projects that are considered "good" code that can be used for >>>>> reference? >>>>> >>>> -- >>> Job board: http://jobs.nodejs.org/ >>> New group rules: >>> https://gist.github.com/othiym23/9886289#file-moderation-policy-md >>> Old group rules: >>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "nodejs" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to nodejs+un...@googlegroups.com. >>> To post to this group, send email to nod...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/nodejs/9c94bbe3-2821-4f02-bb72-8a384a3acbd0%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/nodejs/9c94bbe3-2821-4f02-bb72-8a384a3acbd0%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/1d1d67e0-840a-4ece-b262-fae7a4a2856a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.