{"action":"created","issue":{"url":"https://api.github.com/repos/howdyai/botkit/issues/333","repository_url":"https://api.github.com/repos/howdyai/botkit","labels_url":"https://api.github.com/repos/howdyai/botkit/issues/333/labels{/name}","comments_url":"https://api.github.com/repos/howdyai/botkit/issues/333/comments","events_url":"https://api.github.com/repos/howdyai/botkit/issues/333/events","html_url":"https://github.com/howdyai/botkit/issues/333","id":166724897,"number":333,"title":"Running different bots on same server","user":{"login":"SHBelsky","id":15164473,"avatar_url":"https://avatars.githubusercontent.com/u/15164473?v=3","gravatar_id":"","url":"https://api.github.com/users/SHBelsky","html_url":"https://github.com/SHBelsky","followers_url":"https://api.github.com/users/SHBelsky/followers","following_url":"https://api.github.com/users/SHBelsky/following{/other_user}","gists_url":"https://api.github.com/users/SHBelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/SHBelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SHBelsky/subscriptions","organizations_url":"https://api.github.com/users/SHBelsky/orgs","repos_url":"https://api.github.com/users/SHBelsky/repos","events_url":"https://api.github.com/users/SHBelsky/events{/privacy}","received_events_url":"https://api.github.com/users/SHBelsky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/howdyai/botkit/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/howdyai/botkit/labels/web%20services","name":"web services","color":"d93f0b"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-21T02:40:31Z","updated_at":"2016-07-25T13:57:29Z","closed_at":null,"body":"I've been experimenting with different bots (namely Facebook and Twilio), and I was wondering if there was a way to host both a Facebook and Twilio bot in the same NodeJS project. When I currently try to do this, I can't create distinct web servers for both bots because they need to occupy the proper port, but they can't both occupy the same port.\r\n\r\nI understand that you can use your own Express server instead of instantiating a new web server for each bot, but the documentation is unclear on how exactly to implement it. I've gone through both [the Facebook Messenger](https://github.com/mvaragnat/botkit-messenger-express-demo) and [Slack](https://github.com/mvaragnat/botkit-express-demo) examples, but I haven't been able to replicate it in the way that I would like. \r\n\r\nI'd ideally like to use one Express server for both Facebook and Twilio, then set up the proper routes (e.g. `https://mysite.com/facebook/receive` and `https://mysite.com/twilio/receive`) with it. With Facebook, [the routes don't seem so bad](https://github.com/mvaragnat/botkit-messenger-express-demo/blob/master/app/routes/routes.js), but I get confused [looking at the controller](https://github.com/mvaragnat/botkit-messenger-express-demo/blob/master/app/controllers/botkit.js). I'm confused on how much I need in order to have a single Express server (which, ideally, would also have a simple website or frontend aside from the bots) that also has the Botkit bots.\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/howdyai/botkit/issues/comments/234960335","html_url":"https://github.com/howdyai/botkit/issues/333#issuecomment-234960335","issue_url":"https://api.github.com/repos/howdyai/botkit/issues/333","id":234960335,"user":{"login":"SHBelsky","id":15164473,"avatar_url":"https://avatars.githubusercontent.com/u/15164473?v=3","gravatar_id":"","url":"https://api.github.com/users/SHBelsky","html_url":"https://github.com/SHBelsky","followers_url":"https://api.github.com/users/SHBelsky/followers","following_url":"https://api.github.com/users/SHBelsky/following{/other_user}","gists_url":"https://api.github.com/users/SHBelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/SHBelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SHBelsky/subscriptions","organizations_url":"https://api.github.com/users/SHBelsky/orgs","repos_url":"https://api.github.com/users/SHBelsky/repos","events_url":"https://api.github.com/users/SHBelsky/events{/privacy}","received_events_url":"https://api.github.com/users/SHBelsky/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T13:57:29Z","updated_at":"2016-07-25T13:57:29Z","body":"I was able to do that with an Express `app`, and it's compatible with `createWebhookEndpoints` so that I can still use all the appropriate routes and not need to manually catch the route/action. If I'm understanding what you're doing with `action` correctly, `action` is a placeholder for the different routes for each individual bot you have, correct?\r\n\r\nIf I'm using my own Express server, do I still need to manually subscribe to Facebook events? This might be related to [a separate issue I'm having](https://github.com/howdyai/botkit/issues/337#issuecomment-234950544) when trying to get Facebook location data."}}
{"actor":{"display_login":"SHBelsky"}}