How to Create a Rank Management System using Glitch

How curious, in testing I get this error when I hash out:
image
It reports it as undefined when referenced.
A console.log(process.env);also doesn’t include USER_COOKIE.

4 Likes

Yea… I just moved to paid cloud services.

2 Likes

NOTICE

There have been reports of errors happening while using this API. I have contacted the creator and will keep this post updated on the status.

FIX
To fix this, please re-create your glitch site with the updated link.

Shoutout to @jeditcdisback for helping to fix this issue.

Note: I have received word that documentation has been updated, and this issue should not occur anymore.

5 Likes

glitch = bad for deployment

Glitch is designed for development and not for deploying production grade apps, especially ones you want to keep under :lock: and :key:

6 Likes

You’re not wrong just look at what happened to Krunnie, what would you recommend as a free or affordable alternative to glitch?
(before glitch I used repl, this is infact the first time I have used glitch and it seems simple but realtively easy and smooth to use for basic stuff like this.)

3 Likes

As glitch is made for web hosting it falls asleep after 5mins since last call so to keep it alive you will want to add a new script, call it what you want, I called it KeepAlive.js; Within this type:

const http = require('http');
const express = require('express');
const app = express();
app.get("/", (request, response) => {
  console.log(Date.now() + " Ping Received");
  response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);

Script via https://anidiots.guide/

7 Likes

Thanks for this!

Alternatively, you could use a site like UpTime Robot to visit your site every so often, although this will make keeping Glitch site’s awake way easier.

I added this into the site template, since it will definitely help.

5 Likes

Nothing in the world is free. I’d personally suggest DigitalOcean—although it can be more costly.

Generally, just look for what you specifically need in a cloud service provider.

5 Likes

I recommend Firebase. You won’t be able to do this on the free plan because you can’t send HTTP requests to non-Google services with Firebase Functions. Your best bet would be to go onto the Pay as you go plan. This plan is 100% free as long as you stay within the free tier usage and you can send HTTP requests wherever you need.

To get started with Firebase Functions check here!

Firebase is backed by Google infrastructure and security. It scales 100% automatically and is designed for production use.

Hope this helps!

3 Likes

I would honestly highly recommend buying a VPS for $5/Month from DigitalOcean and host the nobolox.js server on there. It would be way more secure than using glitch.

2 Likes

There are other alternatives, Currently I am using a Pterdactyl Panel to host my bot(s). They offer Free hosting on their VPS, aswell as paid. Such as

:buy: Paid Discord Plan #1
RAM  - 128MB
CPU - 4x 3.90 GHz (Fully Unlocked)
Disk - SSD 1 GB
LOCAT - France
NODE - fr1.eu 
Database - YES
Extra Port - YES
Support : Dedicated

PRICE - 1$

:buy: Paid Discord Plan #2 
RAM  - 512MB
CPU - 4x 3.90 GHz (Fully Unlocked)
Disk - SSD 2 GB
LOCAT - France
NODE - fr1.eu 
Database - YES
Extra Port - YES
Support : Dedicated

PRICE - 2$

:buy: Paid Discord Plan #3
RAM  - 1024MB
CPU - 4x 3.90 GHz (Fully Unlocked)
Disk - SSD 4 GB
LOCAT - France
NODE - fr1.eu 
Database - YES
Extra Port - YES
Support : Dedicated

PRICE - 3$

(Copied from their plans channel)

It is perfect for this type of Bot, (Screenshots from my custom API that i made for British Army using Bloxy.

image
(96 MB - 99 MB) in Memory.

image (Less than 1% CPU).

3 Likes

Thanks for making this kind of work it will help others with cafes and restaurants that want to make an automated application center. This will make them happy so they don’t have to rank them themselves.

2 Likes

Didn’t work for me. I have no idea what I was doing so I gave up, haha?

1 Like

I would be happy to help you. Please message me with the errors you are receiving.

2 Likes

When running require('dotenv').config({ path: './.env' }) .I get syntax error near unexpected token `‘dotenv’’

1 Like

Any way to stop the glitch app from sleeping? That’s kind of what breaks my thing.

2 Likes

Yes, there is a reply above that covers this issue.

1 Like

You need to install dotenv FIRST in the command line.
I do cover it in my tutorial, Also make sure your path is correct i.e ./.env

Ah I see it, thank you. This really helped.

I dont see the console. I only see the output.