Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 253 forks source link

Heroku hosting, changing port, using a forked version #101

Closed danielnjoo closed 6 years ago

danielnjoo commented 6 years ago

Hi, I've seen similar issues, but can't seem to find a solution that works:

Hosting on heroku requires a different port so I changed line 31 of BootBot.js to:

this.app.set('port', process.env.PORT || 3000);

And tried changing my package.json to use relative (local) file paths, which didn't work. So I tried linking it to a forked version on GitHub like so:

"bootbot": "https://github.com/danielnjoo/bootbot/tarball/master",

(Also tried appending Git+ to the front)

But all fail on deploying to heroku with the following error:

remote: -----> Building dependencies
remote:        Installing node modules (package.json + package-lock)
remote:        npm ERR! path /tmp/build_4e98ad92f183bbb8473f7c8cea6a64dc/node_modules/bootbot
remote:        npm ERR! code ELOOP
remote:        npm ERR! errno -40
remote:        npm ERR! syscall access
remote:        npm ERR! ELOOP: too many symbolic links encountered, access '/tmp/build_4e98ad92f183bbb8473f7c8cea6a64dc/node_modules/bootbot'
remote:        
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /app/.npm/_logs/2018-01-05T02_45_15_488Z-debug.log
remote: 
remote: -----> Build failed
Pandawan commented 6 years ago

Here's how I did it:

const bootbot = require('bootbot');
const bot = new bootbot({
    accessToken: process.env.ACCESS_TOKEN,
    verifyToken: process.env.VERIFY_TOKEN,
    appSecret: process.env.APP_SECRET
});

// All the bot logic here

bot.start(process.env.PORT || 3000);
mraaroncruz commented 6 years ago

I'll close this because @PandawanFr's solution should work and @danielnjoo hasn't responded. Thanks @PandawanFr