So my bot runs on Glitch (discord.js) and I happen to attempt to run it 24/7 with this code in server.js
:
const express = require("express");
const app = express();
app.get("/", (request, response) => {
console.log("Ping received!");
response.sendStatus(200);
});
// listen for requests :)
const listener = app.listen(process.env.PORT, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
It will not run, not even if I had the tab open, and I made sure I had no errors. I had another bot with the same code that runs 24/7 with the same code. I also made sure I had this in index.js
(my main bots file): const server = require('./server.js'); const app = express();
I don’t know what went wrong in my thinking.