error anyone can help me to solve this?
This means your app is already binded to port 3000 somewhere.
How to change it then?
I’d imagine you have two places in your code where you’re setting up a listener to port 3000 (or process.env.PORT
). You’ll need to move everything to the same listener and get rid of one of them so your code doesn’t connect to the port more than once. For any more specific guidance, folks will need to be able to see your code.
I can give you access my project name is Pikachu
Pardon the notification. Cori could you give me specific guidence on doing this?
@Fyrlex Make sure you don’t have any app.listeners open to Port: 3000 as this will not work
The way that you would do this is you go to your .env file in your directory.
(If not click New File and type in the filename .env
).
Set your PORT by Defining as below. The reason your getting these errors would be because you have multiple listeners like in this image:
PORT=3000
Put all of your express/server code in one file. If you add app.listen
twice to the same port, it will give that error. This is a good way to avoid this error.
All of this is in my index.js file
I have these lines for keeping the bot alive I believe
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 900000);
I am also trying to create a webhook using Discord Bot List’s API
const dbl = new DBL('token', { webhookPort: 3000, webhookAuth: 'password'});
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
Try ps
and kill any processes already running? That might cause severe damage though
Checkout this thread for more info on creating an event for DBL API
[Solved] DBL Vote Webhook Error
Didn’t get anything besides “Webhook running at http://0.0.0.0:0/dblwebhook” like the user said. The demo file also is no longer existing. I tried voting and doing the “Test” option and nothing came through.