{"action":"created","issue":{"url":"https://api.github.com/repos/HenningM/express-ws/issues/8","labels_url":"https://api.github.com/repos/HenningM/express-ws/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/HenningM/express-ws/issues/8/comments","events_url":"https://api.github.com/repos/HenningM/express-ws/issues/8/events","html_url":"https://github.com/HenningM/express-ws/issues/8","id":55441347,"number":8,"title":"How does this behave with routers?","user":{"login":"nicola","id":1424850,"avatar_url":"https://avatars.githubusercontent.com/u/1424850?v=3","gravatar_id":"","url":"https://api.github.com/users/nicola","html_url":"https://github.com/nicola","followers_url":"https://api.github.com/users/nicola/followers","following_url":"https://api.github.com/users/nicola/following{/other_user}","gists_url":"https://api.github.com/users/nicola/gists{/gist_id}","starred_url":"https://api.github.com/users/nicola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicola/subscriptions","organizations_url":"https://api.github.com/users/nicola/orgs","repos_url":"https://api.github.com/users/nicola/repos","events_url":"https://api.github.com/users/nicola/events{/privacy}","received_events_url":"https://api.github.com/users/nicola/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-26T02:33:56Z","updated_at":"2015-11-01T15:06:03Z","closed_at":null,"body":"Hey there,\r\nawesome library that removes a lot of hassle, really!\r\n\r\nI have this particular use case in which I am releasing a library which expose a Express router,\r\nso here is the following use case:\r\n\r\n```\r\nvar linkedDataProvider = require(\"./ldp\")\r\nvar express = require(\"express\")\r\nvar app = express();\r\napp.use('/test', ldp({patch: true}));\r\n```\r\n\r\nNow, the implementation of ldp is as following:\r\n\r\n```\r\nmodule.exports = function(opts) {\r\n  var router = new express.Router();\r\n  [...]\r\n  router.post(\"/\", postOrPatch);\r\n  router.delete(\"/\", deleteObj);\r\n  [...]\r\n  return router;\r\n}\r\n```\r\n\r\nNow, if I want to include\r\n\r\n```\r\nrouter.ws(''/\", realTime);\r\n```\r\n\r\nHow can make this happen?\r\n\r\nMy ideas are the following\r\n\r\n- I require('express-ws')(router) ?\r\n- I have express-ws outside my library, so if you need you can set extra property\r\n- I have to have another function for creating ldp routes like `ldp(route)(app)`\r\n\r\nThanks a lot for your time"},"comment":{"url":"https://api.github.com/repos/HenningM/express-ws/issues/comments/152833280","html_url":"https://github.com/HenningM/express-ws/issues/8#issuecomment-152833280","issue_url":"https://api.github.com/repos/HenningM/express-ws/issues/8","id":152833280,"user":{"login":"Prior99","id":1491574,"avatar_url":"https://avatars.githubusercontent.com/u/1491574?v=3","gravatar_id":"","url":"https://api.github.com/users/Prior99","html_url":"https://github.com/Prior99","followers_url":"https://api.github.com/users/Prior99/followers","following_url":"https://api.github.com/users/Prior99/following{/other_user}","gists_url":"https://api.github.com/users/Prior99/gists{/gist_id}","starred_url":"https://api.github.com/users/Prior99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Prior99/subscriptions","organizations_url":"https://api.github.com/users/Prior99/orgs","repos_url":"https://api.github.com/users/Prior99/repos","events_url":"https://api.github.com/users/Prior99/events{/privacy}","received_events_url":"https://api.github.com/users/Prior99/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T15:06:03Z","updated_at":"2015-11-01T15:06:03Z","body":"+1"}}