I don't want to keep using the IP 0.0.0.0/0. Basic connection script for pinging:
function connectToServer(callback) {
try {
const express = require('express');
const app = express();
const startTime = Date.now();
const server = app.listen(() => {
const port = server.address().port;
callback(['SUCCESS', port]);
app.get('/', async (req, res) => {
const uptime = Math.floor((Date.now() - startTime) / 1000);
res.send(`[NEBULA]: Nebula is online with port number ${port}! Uptime: ${uptime} seconds.`);
});
});
}
catch (error) {
callback(['GATEWAY_ERROR', error]);
}
}
module.exports = connectToServer;```
Also, my replit url is `https://nebulajs.cosmocreates.repl.co`. It's hosted on different port numbers, for example:
`[NEBULA]: Nebula is online with port number 61293! Uptime: 0 seconds.`
However, I'm not sure how to implement MongoDB for this, since I keep getting this error:
```MongoServerSelectionError: connection <monitor> to <ip> closed```
Here's the client ready script if you need it in file.