Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

how to make it online in repl.it pls tell #19

Open
SDelitegamer opened this issue Jan 28, 2021 · 1 comment
Open

how to make it online in repl.it pls tell #19

SDelitegamer opened this issue Jan 28, 2021 · 1 comment

Comments

@SDelitegamer
Copy link

how to make it online in repl.it?

@nachoofg
Copy link

nachoofg commented Sep 10, 2021

Put all code, install express and ping-monitor, [npm i express ping-monitor]. In bot.js up put this

const keepAlive = require('./server');
const Monitor = require('ping-monitor');
 
keepAlive();
const monitor = new Monitor({
    website: 'Here your second repl',
    title: 'Second',
    interval: 10 // minutes
});
 
monitor.on('up', (res) => console.log(`${res.website} its on`));
monitor.on('down', (res) => console.log(`${res.website} down - ${res.statusMessage}`));
monitor.on('stop', (website) => console.log(`${website} stop.`) );
monitor.on('error', (error) => console.log(error));

And now create a file with server.js name and put this

const express = require('express')
const server = express();
 
server.all('/', (req, res) => {
    res.send('The bot is on.');
});
 
module.exports = () => {
    server.listen(3000, () => {
        console.log('Server ready..');
    });
    return true;
}

Well you now create a new repl with name second, and install express and ping monitor and repeat the first step. but in

website: 'repl',

Put the ping monitor repl link and run

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants