Web view not displaying

Web view is not dislaying for me even if I search it up it does not display it and i need to because in the tutorial for the discord bot i need the link to give it to a hoster to keep it up 24/7

Hey there! Could you send a screen shot? Could you also move this to replit help seeing as you don’t need help with your code.

2 Likes

Hey @elevatorexplore! Welcome to the community!

You will need to create a website to be hosted by your Repl. Then you will be able to use the URL provided to allow the Repl to be awake.

You can also use Replit’s Always On feature to keep your Repl on.

1 Like

Could you send a link to your repl?

1 Like

If you’re trying to make a discord bot then you’re likely not making any output, hence why no webview is displayed. The bot will be on while it’s running, and you can buy powerups to make it run infinitely.
Hope this helps!

Hey there @elevatorexplore! Welcome to the community, you are not able to view WebView because you are not declaring the app host, to do this, place this package in your index.js file at the top of the page:
const express = require("express"); const app = express(); const port = 3000;

Then at the bottom of the page, since you are hosting a discord bot, place this code at the bottom of the page (but above the client.login("..."); line):
`app.get(‘/’, (req, res) => {
res.send(“Hello world!”);
});

app.listen(port, () => {
console.log(“server online”);
});`

This is the default format for most cases of hosting bots online 24/7, but some bots may have a custom dashboard already set up, so this isn’t really required, an example of a bot using a custom dashboard is Pogy, which has a specialized dashboard.js file, changes are not needed for this particular bot, but for the bot you’re hosting, these changes are needed to host WebView.

1 Like