title: How to set content type globally in node.js (express)
body: <p>I might be wrong but I wasn't able to find this in any documentation. 
  I am trying to set content type globally for any response and did it like:</p>
  
  <pre><code>    // Set content type GLOBALLY for any response.
    app.use(function (req, res, next) {
      res.contentType('application/json');
      next();
    });
  </code></pre>
  
  <p>before defining my routes.</p>
  
  <pre><code> // Users REST methods.
    app.post('/api/v1/login', auth.willAuthenticateLocal, users.login);
    app.get('/api/v1/logout', auth.isAuthenticated, users.logout);
    app.get('/api/v1/users/:username', auth.isAuthenticated, users.get);
  </code></pre>
  
  <p>For some reason this doesn't work. Do you know what I am doing wrong? Setting it in each method separately, works but I want it globally...</p>