Discuss Scratch

Titanium01
Scratcher
27 posts

Keep a Repl running.

How do I keep a node.js repl from sleeping, I saw a post about this some time ago but I can't find it.
Raihan142857
Scratcher
1000+ posts

Keep a Repl running.

add
require('http').createServer().listen(8080);
then use uptime robot

Last edited by Raihan142857 (April 30, 2021 16:41:54)

Socialix
Scratcher
1000+ posts

Keep a Repl running.

I believe you need to pay for the Hacker subscription for that.
Raihan142857
Scratcher
1000+ posts

Keep a Repl running.

Socialix wrote:

I believe you need to pay for the Hacker subscription for that.
If you use uptime robot, no
-william27-
Scratcher
81 posts

Keep a Repl running.

Here is the solution I use for all of my repls:
  1. Set up the repl
  2. Add a http server, @Raihan142857 had some great code above
  3. Set up something like Uptime ( https://uptimerobot.com/]Uptime ) Robot or Upptime ( https://upptime.js.org/]Upptime )
  4. Then add your website to it by getting the repl.co link, it should look like replname.repluser.repl.co or repluser.repl.co
  5. Restart the repl
  6. Try to go to the page, it should be blank
  7. Done! Your repl will be kept alive
I use this for all of my websites (status.onedot.cf and stats.wgyt.tk) because it is free, and works well.

Powered by DjangoBB