/* Define custom server-side HTTP routes for lineman's development server
 *   These might be as simple as stubbing a little JSON to
 *   facilitate development of code that interacts with an HTTP service
 *   (presumably, mirroring one that will be reachable in a live environment).
 *
 * It's important to remember that any custom endpoints defined here
 *   will only be available in development, as lineman only builds
 *   static assets, it can't run server-side code.
 *
 * This file can be very useful for rapid prototyping or even organically
 *   defining a spec based on the needs of the client code that emerge.
 *
 */

module.exports = {
  drawRoutes: function(app) {
    // notifications require user to be logged in
    // or be using a cli with a valid key

    // get all
    app.get('/api/v1/notifications', function(req, res){
      res.json([
        {
          id : "51dcb40d4a31e7a3cb000010",
          kind: "argument",
          read: true,
          link: "submissions/51dcb40d4a31e7a3cb000011",
          from: "Bob",
          // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
          // Of our options, the Unix date string seems the most sane.
          date: 1374453860654,
          humanReadableDate: "10 minutes ago",
        },
        {
          id : "51dcb40d4a31e7a3cb000031",
          kind: "nitpick",
          read: true,
          link: "http://localhost:8000/submissions/51dcb40d4a31e7a3cb00000f",
          from: "Alice",
          date: 1374453865190,
          humanReadableDate: "about 12 hours ago",
        },
        {
          id : "51dcb40d4a31e7a3cb000012",
          kind: "argument",
          read: false,
          link:  "http://localhost:8000/submissions/51dcb40d4a31e7a3cb00000f",
          from: "Bob",
          date: 1374453866182,
          humanReadableDate: "about a day ago"
        },
      ]);
    });

    // mark a notification as read
    app.put('/api/v1/notifications/:id', function(req, res){
      res.json({ message: "OK, "+req.params });
    });

    // delete notification
    app.delete('/api/v1/notifications/:id', function(req, res){
      res.json({ message: "OK, "+req.params });
    });
  }
};

@@ -677,1543 +677,8 @@
 ) %7B%0A
-    // notifications require user to be logged in%0A    // or be using a cli with a valid key%0A%0A    // get all%0A    app.get('/api/v1/notifications', function(req, res)%7B%0A      res.json(%5B%0A        %7B%0A          id : %2251dcb40d4a31e7a3cb000010%22,%0A          kind: %22argument%22,%0A          read: true,%0A          link: %22submissions/51dcb40d4a31e7a3cb000011%22,%0A          from: %22Bob%22,%0A          // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date%0A          // Of our options, the Unix date string seems the most sane.%0A          date: 1374453860654,%0A          humanReadableDate: %2210 minutes ago%22,%0A        %7D,%0A        %7B%0A          id : %2251dcb40d4a31e7a3cb000031%22,%0A          kind: %22nitpick%22,%0A          read: true,%0A          link: %22http://localhost:8000/submissions/51dcb40d4a31e7a3cb00000f%22,%0A          from: %22Alice%22,%0A          date: 1374453865190,%0A          humanReadableDate: %22about 12 hours ago%22,%0A        %7D,%0A        %7B%0A          id : %2251dcb40d4a31e7a3cb000012%22,%0A          kind: %22argument%22,%0A          read: false,%0A          link:  %22http://localhost:8000/submissions/51dcb40d4a31e7a3cb00000f%22,%0A          from: %22Bob%22,%0A          date: 1374453866182,%0A          humanReadableDate: %22about a day ago%22%0A        %7D,%0A      %5D);%0A    %7D);%0A%0A    // mark a notification as read%0A    app.put('/api/v1/notifications/:id', function(req, res)%7B%0A      res.json(%7B message: %22OK, %22+req.params %7D);%0A    %7D);%0A%0A    // delete notification%0A    app.delete('/api/v1/notifications/:id', function(req, res)%7B%0A      res.json(%7B message: %22OK, %22+req.params %7D);%0A    %7D);%0A
   %7D%0A

Remove outdated Lineman route stubs.