title: Using express JS for logging out a user, how do I correctly send a success response over to Backbone?
body: <p>I am learing express JS and backbone.</p>
  
  <p>On the express.js side I have the follwing code which logs out a user:</p>
  
  <pre><code>app.get('/logout', function(req, res) {
  
      req.logout();
  
      res.send('How do I correctly send a success response to the Backbone model?');
  });
  </code></pre>
  
  <p>On the Backbone client side, I have created a model which hits: <code>http://mysite:3000/logout</code> url.</p>
  
  <p>Here is the code of the model:</p>
  
  <pre><code>define([
      'underscore',
      'backbone'
  ], function(_, Backbone) {
  
      var CheckLoginModel = Backbone.Model.extend({
  
          url : 'http://localhost:3000/logout'
      });
  
      return CheckLoginModel;
  });
  </code></pre>
  
  <p>Now, on the view, I instantiate the model and expect a success or error response:</p>
  
  <pre><code>var logoutModel = new LogoutModel(),
  
  logoutModel.fetch({
  
      success : function (model, xhr, options) {
  
          // how do I use express to correctly send a success response to Backbone?
      },
  
      error : function (model, xhr, options) {
  
      }
  });
  </code></pre>
  
  <p>P.S.</p>
  
  <p>In my express code, i could just send some dummy data and I'd be done with it... but I'm not sure that's the correct way:</p>
  
  <pre><code>app.get('/logout', function(req, res) {
  
      req.logout();
  
      res.send({ dummydata : 'dummydata' });
  
     // not sure sending dummy data like this is the way.
  });
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Ty!</p>