{"action":"created","issue":{"url":"https://api.github.com/repos/RafalWilinski/express-status-monitor/issues/64","repository_url":"https://api.github.com/repos/RafalWilinski/express-status-monitor","labels_url":"https://api.github.com/repos/RafalWilinski/express-status-monitor/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/RafalWilinski/express-status-monitor/issues/64/comments","events_url":"https://api.github.com/repos/RafalWilinski/express-status-monitor/issues/64/events","html_url":"https://github.com/RafalWilinski/express-status-monitor/issues/64","id":191247841,"number":64,"title":"Using module with socket.io in project","user":{"login":"niallobrien","id":1525669,"avatar_url":"https://avatars.githubusercontent.com/u/1525669?v=3","gravatar_id":"","url":"https://api.github.com/users/niallobrien","html_url":"https://github.com/niallobrien","followers_url":"https://api.github.com/users/niallobrien/followers","following_url":"https://api.github.com/users/niallobrien/following{/other_user}","gists_url":"https://api.github.com/users/niallobrien/gists{/gist_id}","starred_url":"https://api.github.com/users/niallobrien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niallobrien/subscriptions","organizations_url":"https://api.github.com/users/niallobrien/orgs","repos_url":"https://api.github.com/users/niallobrien/repos","events_url":"https://api.github.com/users/niallobrien/events{/privacy}","received_events_url":"https://api.github.com/users/niallobrien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-23T11:35:15Z","updated_at":"2016-12-23T20:09:56Z","closed_at":null,"body":"Hi, I'm trying to add socket.io support to Hackathon Starter (https://github.com/sahat/hackathon-starter/) and am running into the following issue: https://github.com/sahat/hackathon-starter/issues/621#issuecomment-261622512\r\n\r\nThe person who commented was right, disabling Express-Status-Monitor does work, but ideally I'd like to get everything working. The documentation seems a little vague, you mention setting a `port` but I don't see that config option documented. Regardless, I tried \r\n```\r\napp.set('port', process.env.PORT || 3000);\r\n...\r\n...\r\n...\r\napp.use(expressStatusMonitor({ websocket: io, port: app.get('port') }));\r\n``` \r\nand I still cannot get everything to work correctly. `io` is declared as so:\r\n```\r\nconst app = express();\r\nconst server = require('http').Server(app);\r\nconst io = require('socket.io')(server);\r\n```\r\nCan you please advise? Thanks in advance."},"comment":{"url":"https://api.github.com/repos/RafalWilinski/express-status-monitor/issues/comments/269040244","html_url":"https://github.com/RafalWilinski/express-status-monitor/issues/64#issuecomment-269040244","issue_url":"https://api.github.com/repos/RafalWilinski/express-status-monitor/issues/64","id":269040244,"user":{"login":"RafalWilinski","id":3391616,"avatar_url":"https://avatars.githubusercontent.com/u/3391616?v=3","gravatar_id":"","url":"https://api.github.com/users/RafalWilinski","html_url":"https://github.com/RafalWilinski","followers_url":"https://api.github.com/users/RafalWilinski/followers","following_url":"https://api.github.com/users/RafalWilinski/following{/other_user}","gists_url":"https://api.github.com/users/RafalWilinski/gists{/gist_id}","starred_url":"https://api.github.com/users/RafalWilinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RafalWilinski/subscriptions","organizations_url":"https://api.github.com/users/RafalWilinski/orgs","repos_url":"https://api.github.com/users/RafalWilinski/repos","events_url":"https://api.github.com/users/RafalWilinski/events{/privacy}","received_events_url":"https://api.github.com/users/RafalWilinski/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T20:09:56Z","updated_at":"2016-12-23T20:09:56Z","body":"@niallobrien \r\n\r\nSorry for taking it so much time but I'm really busy right now. \r\n\r\nI've investigated this issue and here's what I came with:\r\n```\r\nconst socketIoPort = 3001;\r\nconst app = express();\r\nconst io = require('socket.io')(socketIoPort);\r\n\r\napp.set('port', process.env.PORT || 3000);\r\napp.use(expressStatusMonitor({ websocket: io, port: socketIoPort }));\r\n```\r\n\r\nYou have to create `socket.io` instance using port parameter, not `HttpServer`. Also, you cannot use the same port because of `EADDRINUSE`.\r\n\r\nHope that helps."}}
{"actor":{"display_login":"RafalWilinski"}}