Ask coding questions

← Back to all posts
example of a file name and code of a webserver in node.js
MohammedAbdul10 (2)

im new to node.js and im making a github cloned giveaway bot (for discord) but I have to host my discord bot 24/7 can anyone pls give an example?

Answered by Coder100 (18222) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18222)

Sure:

const http = require("http");
http.createServer((_, res) => res.end("Alive!")).listen(8080)
MohammedAbdul10 (2)

thanks but in which file should i paste? @Coder100

MohammedAbdul10 (2)

got it i had to put it on index.js btw thanks :)