Glitch.me project appears down even though not - Uptime robot


#1

stuck

Hello, I’ve seen some suggestions here saying Uptime Robot will help keep my bot alive. My uptime robot says my app is down (even though I know from discord server that it is online). I’m uploading the screenshot of my “projectname.glitch.me” site. Basically it’s stuck like that. Even though I didn’t edit index.html, the default page is should be different.

Is it possibly because I changed my project name to something non-unique 2 days ago?


#2

Hi, what’s your project name so I can take a look at the code?


#3

Hi @Nameless9! Chances are that your projects server isn’t serving up a default route. For example if you’re using Express to serve your public pages you’ll need something that looks like

app.get('/', function(request, response) {
  response.sendFile(__dirname + '/views/index.html');
});

And something that looks like

const listener = app.listen(process.env.PORT, function() {
  console.log('Your app is listening on port ' + listener.address().port);
});

If you’re missing those pieces your app’s public page will never load.

As @levistep32 points out, knowing your project name will help us give more specific answers.


#4

Thank you for your replies. You are right. I didn’t make a routing for my discord.js bot yet, so that’s a logical explanation. My project name is geniusbot.

Edit: I’m not using Express yet. So I guess I should install express and follow the guide on routing?


#5

You’ve actually got Express already installed so that’s a start. You could put this in place by creating a file called server.js with these contents:

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);
});

and then in bot.js include this line:
const server = require('./server.js');

Then your bot will have an empty web page responding at https://geniusbot.glitch.me that UptimeRobot can ping.


Is there a way to run my Discord.js Bot 24/7
#6

thank you for your help cori. the website is up and it looks like it’s good from uptime robot’s side too. thanks again