Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Keep every Glitch.com-Project up
No Name Pro
No Name Pro

Posted on

     

Keep every Glitch.com-Project up

How it works

The HTTP-Listener below opens a Port. So if a user send a HTTP-Request to your Page, this Listener will answer.
A normal free Glich.com Project shutdown automatically when 5 minutes no Request will send to the App.

Method 1: Go to this page every 5 minutest with your browser, to keep your project alive.

But, we all know, it's not a very good method.

So, this tool up will send automatic usingcrontab every 5 Minutes a HTTP-Request to your Listner.

So your server needs just every 5 Minutes a very small progess, and your NodeJS-Application runs 24/7 with the Performance from the Glitch-Servers.

It's just a small server needed, if you don't have a server, i suggest aRaspberry Pi or ask a friend! :D

I will update this article, if i find better soulutions. But the old, works too.

Setup

HTTP-Listener: Set to your NodeJS Applicaion

Just add to yourserver.js this code. No config ishere needed.

letexpress=require("express"),http=require('http'),app=express();app.use(express.static("public"));app.get("/",function(request,response){response.sendStatus(200);// Status: OK});letlistener=app.listen(process.env.PORT,function(){console.log("Your app is listening on port"+listener.address().port);});setInterval(()=>{http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);},280000);

Automatic HTTP-Request: Run on your Server

Run this commands in the Bash. But: Change in the First Line themy-example-nodejs to your Project Name.

PROJECT=my-example-nodejsecho"5 * * * * curl https://$PROJECT.glitch.me/"> /etc/cron.d/glitch-upservice restart cron

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
folliejester profile image
Follie JesteR
  • Joined

they patched it

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

C#-Developer for creating Open-Source Tools and (Web-)Apps on GitHub or private.
  • Location
    Germany, but English is a better langugage
  • Work
    Developer at my Projects
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp