Crucian icon indicating copy to clipboard operation
Crucian copied to clipboard

how to make it online in repl.it pls tell

Open SDelitegamer opened this issue 4 years ago • 1 comments

how to make it online in repl.it?

SDelitegamer avatar Jan 28 '21 05:01 SDelitegamer

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

nnachonesa avatar Sep 10 '21 18:09 nnachonesa