/* ---------------------
routes.js 

For web clients (http and https) you can define an optional RESTful mapping to help route requests to actions.
If the client doesn't specify and action in a param, and the base route isn't a named action, the action will attempt to be discerned from this routes.js file.

- routes remain optional
- actions defiend in params directly `action=theAction` or hitting the named URL for an action `/api/theAction` will always override RESTful routing 
- you can mix explicitly defined params with route-defined params.  If there is an overlap, the route-defined params win
  - IE: /api/user/123?userId=456 => `connection.userId = 123`
  - this is a change from previous versions
- routes defined with the "all" method will be duplicated to "get", "put", "post", and "delete"
- use ":variable" to defined "variable"
- undefined ":variable" will match
  - IE: "/api/user/" WILL match "/api/user/:userId"
- routes are matched as defined here top-down
- you can optionally define a regex match along with your route variable
  - IE: { path:"/game/:id(^[a-z]{0,10}$)", action: "gamehandler" }
  - be sure to double-escape when needed: { path: "/login/:userID(^\\d{3}$)", action: "login" }

example:

{
  get: [
    { path: "/users", action: "usersList" }, // (GET) /api/users
    { path: "/search/:term/limit/:limit/offset/:offset", action: "search" }, // (GET) /api/search/car/limit/10/offset/100
  ],

  post: [
    { path: "/login/:userID(^\\d{3}$)", action: "login" } // (POST) /api/login/123
  ],

  all: [
    { path: "/user/:userID", action: "user" } // (*) / /api/user/123
  ]
}

---------------------- */

////////////
// ROUTES //
////////////

exports.routes = {
    get: [
        // statuses
        { path: '/organizations/:organizationId/printers/:printerId/statuses', action: 'statusList' },

        // printers
        { path: '/organizations/:organizationId/printers/:printerId', action: 'printerGet' },
        { path: '/organizations/:organizationId/printers', action: 'printerList' },

        // users
        { path: '/organizations/:organizationId/users/:userId', action: 'userGet'},
        { path: '/organizations/:organizationId/users', action: 'userList' },

        // organizations
        { path: '/organizations/:organizationId', action: 'organizationGet' },
        { path: '/organizations', action: 'organizationList' }
    ],

    post: [
        // statuses
        { path: '/organizations/:organizationId/printers/:printerId/statuses', action: 'statusCreate' },

        // printers
        { path: '/organizations/:organizationId/printers', action: 'printerCreate' },

        // users
        { path: '/organizations/:organizationId/users', action: 'userCreate' },

        // organizations
        { path: '/organizations', action: 'organizationCreate' }
    ],

    put: [
        // printers
        { path: '/organizations/:organizationId/printers/:printerId', action: 'printerUpdate' },

        // users
        { path: 'organizations/:organizationId/users/:userId', action: 'userUpdate' },

        // organizations
        { path: '/organizations/:organizationId', action: 'organizationUpdate' }
    ],

    delete: [
        // printers
        { path: '/organizations/:organizationId/printers/:printerId', action: 'printerDelete' },

        // users
        { path: '/organizations/:organizationId/users/:userId', action: 'userDelete' },

        // organizations
        { path: '/organizations/:organizationId', action: 'organizationDelete' }
    ]
};

@@ -1708,1824 +1708,54 @@
 t: %5B
-%0A        // statuses%0A        %7B path: '/organizations/:organizationId/printers/:printerId/statuses', action: 'statusList' %7D,%0A%0A        // printers%0A        %7B path: '/organizations/:organizationId/printers/:printerId', action: 'printerGet' %7D,%0A        %7B path: '/organizations/:organizationId/printers', action: 'printerList' %7D,%0A%0A        // users%0A        %7B path: '/organizations/:organizationId/users/:userId', action: 'userGet'%7D,%0A        %7B path: '/organizations/:organizationId/users', action: 'userList' %7D,%0A%0A        // organizations%0A        %7B path: '/organizations/:organizationId', action: 'organizationGet' %7D,%0A        %7B path: '/organizations', action: 'organizationList' %7D%0A    %5D,%0A%0A    post: %5B%0A        // statuses%0A        %7B path: '/organizations/:organizationId/printers/:printerId/statuses', action: 'statusCreate' %7D,%0A%0A        // printers%0A        %7B path: '/organizations/:organizationId/printers', action: 'printerCreate' %7D,%0A%0A        // users%0A        %7B path: '/organizations/:organizationId/users', action: 'userCreate' %7D,%0A%0A        // organizations%0A        %7B path: '/organizations', action: 'organizationCreate' %7D%0A    %5D,%0A%0A    put: %5B%0A        // printers%0A        %7B path: '/organizations/:organizationId/printers/:printerId', action: 'printerUpdate' %7D,%0A%0A        // users%0A        %7B path: 'organizations/:organizationId/users/:userId', action: 'userUpdate' %7D,%0A%0A        // organizations%0A        %7B path: '/organizations/:organizationId', action: 'organizationUpdate' %7D%0A    %5D,%0A%0A    delete: %5B%0A        // printers%0A        %7B path: '/organizations/:organizationId/printers/:printerId', action: 'printerDelete' %7D,%0A%0A        // users%0A        %7B path: '/organizations/:organizationId/users/:userId', action: 'userDelete' %7D,%0A%0A        // organizations%0A        %7B path: '/organizations/:organizationId', action: 'organizationDelete' %7D%0A    
+%5D,%0A%0A    post: %5B%5D,%0A%0A    put: %5B%5D,%0A%0A    delete: %5B
 %5D%0A%7D;

Remove routes