Make sure to follow the video tutorial relating to this page to make sure the steps are followed correctly. If you need any help message me on my discord server.
Make sure to follow the video tutorial relating to this page to make sure the steps are followed correctly. If you need any help message me on my discord server.
Copy and paste the code used in Part 1:
server.js
const express = require('express');
const server = express();
server.all('/', (req, res)=>{
res.setHeader('Content-Type', 'text/html');
res.write('<link href="https://fonts.googleapis.com/css?family=Roboto Condensed" rel="stylesheet"> <style> body {font-family: "Roboto Condensed";font-size: 22px;} <p>Hosting Active</p>');
res.end();
})
function keepAlive(){
server.listen(3000, ()=>{console.log("Server is online!")});
}
module.exports = keepAlive;
index.js - (Added Code Only)
const keepAlive = require("./server");
keepAlive();
client.login(process.env.DISCORD_BOT_TOKEN);
.env
DISCORD_BOT_TOKEN=PutYourTokenHereAsShownInVideo