Your code works 100% well in my projects. When the request to a root dir. has sent, server says OK! to a requestser and console.logs to a console about that.
If your problem is that your project being freezed:
Actually, I’m not an expert, but Glitch possibly could freeze your project if no requests were from OTHER IP addresses (not the server’s). It also might be a node.js timers problem or something.
What do you need is called UptimeRobot. This site just sends requests to URL with some interval (you can change). That would 99% keep your project (bot, site, etc.) alive all the time.
This question is in the wrong category as it’s about Express & regular Node.js. Not Discord.js as there is no reference to the discord.js library at all.
Hey @Jonyk56 to set up UptimeRobot to ping your project to keep it alive you would tell UR to ping https://ender-bot-4-0.glitch.me/. @jarvis394 is correct in that the setInterval code isn’t enough to keep your bot always running, since we restart projects at least every 12 hours. The anidiots.guide article that a lot of people use as a resource mentions this briefly as well.
I’m still not sure what you mean by
so I’m not sure this will fully solve your problem.