How to structure/modularize my NodeJS server-side processing?
<p>I have some processing logic that is currently in my AngularJS front end, modularized away into services in order to keep my controllers clean. However, I need to bring some of this logic to my NodeJS backend.</p>

<p>For example:</p>

<pre><code>function processPost(post){                // In reality I have many many functions so I would like to modularize 
   if(post.verified == true){
      post.status = 'Safe to trust!'
   }
}
</code></pre>

<p>Where should I put this code in my backend and how can I modularize it?
Should it be in the middleware or perhaps in my routes?</p>