node.js Discord Bot running 24/7
What code do I need to use to be able to use uptime robot with node.js on replit for my discord bot?
RYANTADIPARTHI
host it somewhere, or get http servers.
SixBeeps
You need to start an HTTP server one way or another, then link UTR to the auto-generated link for that server.
NightmareTaken
what would be the code to run that server? @SixBeeps
SixBeeps
@NightmareTaken You could do it with Express:
const express = require('express'); const app = express(); app.get('/', (req, res) => { res.send('Hello Express app!') }); app.listen(3000, () => { console.log('server started'); });
NightmareTaken
@SixBeeps Do I need to name the file anything special?
SixBeeps
@NightmareTaken This should be in your index file.
To host in node.js, try this tutorial.