I've dabbled with Rails, and its opinionated nature was one of things I liked best.

From: Aaron Bartell <aaronbartell@xxxxxxxxx>
Sent: Thursday, January 11, 2018 3:36 PM
To: IBMi Open Source Roundtable
Subject: Re: [IBMiOSS] Node code organization

Node.js is a little odd (opinion). For example, I find that apps will
sometimes put the core of the business application in a folder named
'lib'. In RubyOnRails I would consider the lib folder to hold Ruby
extensions and such, nothing to do with the actual business app (model,
view, controller).

Further, within the lib/ folder is the domain folder (i.e. customer) and
within there is the route.js, handler.js, helper.js, model.js, etc. Again,
this is different from my RubyOnRails upbringing where, as Pete pointed
out, you'd delineate by directories first (i.e. all models go in the
models/ directory).

Further, in Node.js there is a practice of creating an index.js in each
directory which, when imported, will appropriate load or do other things
for the remaining files in that directory.

On final note, this is one reason I like RubyOnRails. They picked a folder
structure that worked for 99% of web apps and sent people down that path.

Aaron Bartell
IBM i hosting, starting at $157/month. litmis.com/spaces

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.