Glitch project down but not down


#1

Help its like that when you try to join to the website. But the project works fine. Please help. If you need I can remix the project and invite you in.


#2

Hey @AnriGameSYT!

This happens when a project is being pinged or used repeatedly. This may not be the only reason why but it’s the only one I’ve come across. In your project editor check the project’s “online” status in the top left. If it’s green like below then that means the project is successfully online and viewable; if it’s a GIF with moving circles like below then that means it’s turning itself online repeatedly like in a Node project; or if there’s a bug in the code it will turn offline to prevent more issues.

online
offline
loading

Did you create the website as a website project or a Node project? Depending on which one you chose can help with figuring out the issue.


#3

Hi, yes its the gif. The gif was from the start of the project and worked fine till i tried to use uptimerobot. I have other projects too and only this one didn’t work fine (Error 503). Its a node project because its my discord bot and i’ve not touched the files that come when you create the project. ¿What can I do? And thanks.


#4

Ahh, that clears up a lot. I’ve tested out Glitch + UptimeRobot and they used to work ok, but never really well. Since your project is a Node project UptimeRobot won’t be able to ping your project through the site (example.glitch.me) since it gives a 503 error. If you’re intent on hosting the bot on Glitch I would recommend messing around with different links such as a project invite link (image example below) or the project’s edit link (www.glitch.com/edit/#!/example).

join

If you’re open to hosting the bot elsewhere GitHub and Heroku work wonderfully for me and I can even help you set that up. If you do that using Glitch to edit the bot is also a great idea instead of removing the bot’s code there.


#5

Okay. the problem here is that I tried Heroku and I didn’t like it so much. It was so difficult for me and i couldn’t ever boot the bot! I don’t know how to host on github. On the invite links part I didn’t understand it so much. Do I need to try to use UptimeRobot with the project invite link?


#6

Heroku is pretty tricky to first get online and running, but after you do get it working it’s amazing: easy to bypass the dyno limit, has the bot responding quickly, and easy access to process variables. Again, I can help you set that up with GitHub without giving me your bot’s token or any secrets I could mess with.

The invite link would redirect UptimeRobot to the project editor with permissions to edit/view the project without issues.


#7

Your project is private so I can’t view the code. But judging from the error message, it sounds like you haven’t defined a web server to respond to the uptime robot http request. See this response for some sample code to fix this: Discord Bot project keeps restarting?

If it’s another issue - DM a project join link and we can take a look.


#8

Hi i have this code and I think this is what you mean. And the code you say its the second code right?

FIRST

const app = express();

//
app.use(express.static('public'));

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

app.get("/", (request, response) => {
  response.sendStatus(200);
});

app.listen(process.env.PORT);

setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`); 
}, 280000);

SECOND

const express = require("express")
const expressApp = express()
expressApp.get("/", (req, res) => res.json("OK"))
expressApp.listen(process.env.PORT)

#9

Ok Ill try to fix this if not Ill go to Heroku or github. Thanks.


#10

I wasn’t aware this existed, haha! Sorry if I caused troubles :sweat_smile:


#11

Both should work, but one assumes you have a views/index.html file whereas two doesn’t need any additional files.


#12

Ok idk why the first code that I’ve sended was deleted or idk of the server.js file. The problem was that I didn’t see that. :joy::sob::sob::sob::sob: Sorry for losing your time. Now it works fine. It puts LIVE green button and uptimerobot works. Thank you so much Crazy and Gareth for your help.


#13

Not a problem! Glad we figured it out.