title: Hapi server methods vs server.app.doSomething
body: <p>I am writing a hapi js plugin, and was wondering what's the difference between the two ways of exposing methods that other plugins can use.</p>
  
  <p>Method 1:</p>
  
  <pre><code>server.method("doSomething",
      function () {
          // Something
      });
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>server.app.doSomething = function () {
      // Something
  };
  </code></pre>
  
  <p>In the first approach, the function can later be called as server.doSomething(), while using the second approach as server.app.doSomething().</p>
  
  <p>So why would I use one way instead of another?</p>