{"action":"closed","issue":{"url":"https://api.github.com/repos/pillarjs/router/issues/39","repository_url":"https://api.github.com/repos/pillarjs/router","labels_url":"https://api.github.com/repos/pillarjs/router/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/pillarjs/router/issues/39/comments","events_url":"https://api.github.com/repos/pillarjs/router/issues/39/events","html_url":"https://github.com/pillarjs/router/issues/39","id":138990094,"number":39,"title":"res.send and res.json not available when using router without express?","user":{"login":"sjanuary","id":14993288,"avatar_url":"https://avatars.githubusercontent.com/u/14993288?v=3","gravatar_id":"","url":"https://api.github.com/users/sjanuary","html_url":"https://github.com/sjanuary","followers_url":"https://api.github.com/users/sjanuary/followers","following_url":"https://api.github.com/users/sjanuary/following{/other_user}","gists_url":"https://api.github.com/users/sjanuary/gists{/gist_id}","starred_url":"https://api.github.com/users/sjanuary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjanuary/subscriptions","organizations_url":"https://api.github.com/users/sjanuary/orgs","repos_url":"https://api.github.com/users/sjanuary/repos","events_url":"https://api.github.com/users/sjanuary/events{/privacy}","received_events_url":"https://api.github.com/users/sjanuary/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-07T14:22:08Z","updated_at":"2016-03-07T14:38:09Z","closed_at":"2016-03-07T14:38:09Z","body":"I've been working on an example for the docs for #36 but the following didn't work for me:\r\n\r\n```javascript\r\nvar finalhandler = require('finalhandler')\r\nvar http         = require('http')\r\nvar Router       = require('router')\r\n\r\nvar router = Router()\r\nrouter.get('/', function (req, res) {\r\n  res.setHeader('Content-Type', 'text/plain; charset=utf-8')\r\n  res.json({link: '/abc'})\r\n  res.end()\r\n})\r\n\r\nvar server = http.createServer(function(req, res) {\r\n  router(req, res, finalhandler(req, res))\r\n})\r\n\r\nserver.listen(3000)\r\n```\r\n\r\nInstead I got `TypeError: undefined is not a function`\r\n\r\nIt seems like `res.json` and `res.send` aren't available if a Router is used standalone without Express. Is this by design? I couldn't find anything about it in the docs or in past issues."}}