Hi I'm trying to create a Discord bot using Discord.js and deploy it to Heroku.
I have successfully deploy it to Heroku, but the logs shows an error. Here is where I think the problem is:
app[worker.1]: Error: Cannot find module './config.json'
config.json
cant be found because i put the config.json
file inside a .gitignore
file. This is because i have some credentials (bot token) that i need to protect inside that file. However, the main file needs access to the config.json
in order to run.
Is there any way to still protect the contents of the config.json
file while still being able to run the program? The GitHub repository is set to private, so should i exclude config.json
from .gitignore
instead?