title: Calling server-side code from client on Derby.js
body: <p>I'm new to using Derby.js, and have scaffolded out a project using the yeoman generator-derby package. I thought everything was going fine, but I can't figure out what I'm doing wrong here.</p>
  
  <p>A breakdown:</p>
  
  <ul>
  <li>I have an 'app/dbWp.js' controller that exports several functions, and requires the modules 'mysql', 'async', and 'needle'</li>
  <li><p>In my app/index.js, I import this file and use it like so:</p>
  
  <pre><code>    app.proto.submitWp = function() {
          dbWp.createUser(this.model);
      };
  </code></pre></li>
  <li><p>I call this function from the view/index.jade like so:</p>
  
  <pre><code>button.btn.btn-primary(type="button", on-click="submitWp()")
  </code></pre></li>
  <li><p>In the browser, I get numerous console.error message complaining about the 'fs' module not being defined. After much googling, I discover that it's due to Browserify ignoring the 'fs' module, which subsequently causes problems with modules 'mysql' and 'needle'. But that implies this code is being executed in the browser?</p></li>
  </ul>
  
  <p>So my question is: why is this trying to call the function on the <em>client</em> side? Obviously if it executes on the <em>server</em> side, as I thought it was going to, there wouldn't be a problem requiring these modules. </p>
  
  <p>How can I execute this function on the <em>server</em>? Had this working fine with express + socket.io before, but wanted to change frameworks and give Derby.js a shot.</p>
  
  <p>I'm clearly misunderstanding something about how Derby.js is supposed to work; any help would be appreciated. Thanks!</p>