{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/bassmaster/issues/61","repository_url":"https://api.github.com/repos/hapijs/bassmaster","labels_url":"https://api.github.com/repos/hapijs/bassmaster/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/bassmaster/issues/61/comments","events_url":"https://api.github.com/repos/hapijs/bassmaster/issues/61/events","html_url":"https://github.com/hapijs/bassmaster/issues/61","id":131270981,"number":61,"title":"How to impelement?","user":{"login":"go4cas","id":12674784,"avatar_url":"https://avatars.githubusercontent.com/u/12674784?v=3","gravatar_id":"","url":"https://api.github.com/users/go4cas","html_url":"https://github.com/go4cas","followers_url":"https://api.github.com/users/go4cas/followers","following_url":"https://api.github.com/users/go4cas/following{/other_user}","gists_url":"https://api.github.com/users/go4cas/gists{/gist_id}","starred_url":"https://api.github.com/users/go4cas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go4cas/subscriptions","organizations_url":"https://api.github.com/users/go4cas/orgs","repos_url":"https://api.github.com/users/go4cas/repos","events_url":"https://api.github.com/users/go4cas/events{/privacy}","received_events_url":"https://api.github.com/users/go4cas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-04T07:49:16Z","updated_at":"2016-02-04T13:51:40Z","closed_at":null,"body":"I'm struggling to  figure out how to implement this.\r\n\r\nI have my routes defined in a separate file from my main `server.js`.\r\n\r\nHere's an example of one of my entity routes (`/api/models/order.js`):\r\n\r\n```javascript\r\n'use strict';\r\n\r\nvar Joi = require('joi');\r\nvar OrderController = require(appDir + process.env.PATH_API + process.env.PATH_CONTROLLERS + 'order');\r\nvar orderController = new OrderController;\r\nvar InvoiceController = require(appDir + process.env.PATH_API + process.env.PATH_CONTROLLERS + 'invoice');\r\nvar invoiceController = new InvoiceController;\r\nvar OrderItemController = require(appDir + process.env.PATH_API + process.env.PATH_CONTROLLERS + 'order-item');\r\nvar orderItemController = new OrderItemController;\r\n\r\nmodule.exports = [\r\n  {\r\n    method: 'GET',\r\n    path: '/orders/{id}',\r\n    config: {\r\n      description: 'Get the summary data of a specific Order',\r\n      tags: ['api'],\r\n      handler: orderController.getOrder,\r\n      validate: {\r\n        params: {\r\n          id: Joi.number().integer().required()\r\n        },\r\n        query: {\r\n          raw: Joi.boolean()\r\n        }\r\n      },\r\n      auth: false,\r\n      jsonp: 'callback'\r\n    }\r\n  },\r\n  {\r\n    method: 'GET',\r\n    path: '/orders/{id}/invoices',\r\n    config: {\r\n      description: 'Get the invoices data linked to a specific Order',\r\n      tags: ['api'],\r\n      handler: invoiceController.getInvoicesForOrder,\r\n      validate: {\r\n        params: {\r\n          id: Joi.number().integer().required()\r\n        },\r\n        query: {\r\n          raw: Joi.boolean()\r\n        }\r\n      },\r\n      auth: false,\r\n      jsonp: 'callback'\r\n    }\r\n  },\r\n  {\r\n    method: 'GET',\r\n    path: '/orders/{id}/orderitems',\r\n    config: {\r\n      description: 'Get the order items data linked to a specific Order',\r\n      tags: ['api'],\r\n      handler: orderItemController.getOrderItemsForOrder,\r\n      validate: {\r\n        params: {\r\n          id: Joi.number().integer().required()\r\n        },\r\n        query: {\r\n          raw: Joi.boolean()\r\n        }\r\n      },\r\n      auth: false,\r\n      jsonp: 'callback'\r\n    }\r\n  }\r\n]\r\n\r\n```\r\nI would like to have a `/orders/{id}/batch` route that combines the responses from the `orders`, `invoices` and `orderitems` routes.\r\n\r\nCan you perhaps guide me on how to implement this?\r\n"},"comment":{"url":"https://api.github.com/repos/hapijs/bassmaster/issues/comments/179849023","html_url":"https://github.com/hapijs/bassmaster/issues/61#issuecomment-179849023","issue_url":"https://api.github.com/repos/hapijs/bassmaster/issues/61","id":179849023,"user":{"login":"go4cas","id":12674784,"avatar_url":"https://avatars.githubusercontent.com/u/12674784?v=3","gravatar_id":"","url":"https://api.github.com/users/go4cas","html_url":"https://github.com/go4cas","followers_url":"https://api.github.com/users/go4cas/followers","following_url":"https://api.github.com/users/go4cas/following{/other_user}","gists_url":"https://api.github.com/users/go4cas/gists{/gist_id}","starred_url":"https://api.github.com/users/go4cas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go4cas/subscriptions","organizations_url":"https://api.github.com/users/go4cas/orgs","repos_url":"https://api.github.com/users/go4cas/repos","events_url":"https://api.github.com/users/go4cas/events{/privacy}","received_events_url":"https://api.github.com/users/go4cas/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T13:51:40Z","updated_at":"2016-02-04T13:51:40Z","body":"Do you mean, doing something like this?:\r\n```javascript\r\nhandler: orderController.getOrderBatch(request)\r\n```\r\nI get `request is not defined`."}}