Ask coding questions

← Back to all posts
Need some help with "Make sure your repl has a port open and is ready to receive HTTP traffic."
segow (0)

After following one of's own tutorials for making a static site generator, I added a few of my own content pages and now when opening a link I get the error message:

This is despite the fact that I had just opened a port in the shell, as explained in the tutorial, with the commands "cd public" and "python -m http.server"

Any help on this would be much appreciated!

Answered by Coder100 (18109) [earned 5 cycles]
View Answer
segow (0)
Coder100 (18109)

that's because that is the shell not the replit run button.

The shell basically only runs commands, and all those features are lost when you click the run button. Instead, create a new .replit file, and add this:

run = "sh"

then, create a and add this:

cd public
python -m http.server