Hello! I’m new at programming so i want to understand why should i use express to launch my discord bot?
const express = require(“express”);
const keepalive = require(“express-glitch-keepalive”);
const app = express();
app.use(keepalive);
app.get("/", (req, res) => {
res.json(“Бот запущен!”);
});
app.get("/", (request, response) => {
response.sendStatus(200);
});
app.listen(process.env.PORT);
I found that somewhere…
While you don’t need express with your bot, it can be useful if you want to host an informational site along with your bot. For example, visiting a bots page without express with show a screen that loads forever (the bot will still work, keep in mind), but visiting a bots page that has express can show a webpage. The code you have showed will make your bot’s webpage show a little bit a text upon visiting.
soooo i don`t really need this?
ok i got it but… what is keepalive express