Crucian
Crucian copied to clipboard
how to make it online in repl.it pls tell
how to make it online in repl.it?
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