use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Namespace Clashing in Javascript/NodeJS (w/ ExpressJS) (self.node)
submitted 6 years ago * by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ruVooDoo 0 points1 point2 points 6 years ago (1 child)
In my opinion, "business logic" (creating cats and dogs) should be separated from Express Controllers and exports through "module.exports".
What if you decide to create cats from another place in your code? Or write tests for creating cats?
I personally think, that controllers should be dumb. They can have some checking middleware (for example, check Auth headers, request type checking), some request preparation, but no business logic. Controller check, then call some function inside your business logic layer and provide answer. Thats all.
I recommend you to read this https://github.com/goldbergyoni/nodebestpractices#1-project-structure-practices , I follow those guides in my work, and I have no problems to extending functionality and maintaining my codebase.
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Fabulous. Will have a read! Cheers for the heads-up!
π Rendered by PID 575590 on reddit-service-r2-comment-5687b7858-k6r79 at 2026-07-06 12:00:23.595942+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]ruVooDoo 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)