Ask coding questions

← Back to all posts
Why is the IDE preview blank?
Socked (0)

I am making a NodeJS Express app and the preview in the IDE is blank even though I can see it in my browser.

The problem only happens if I use helmet.

Answered by xfinnbar (134) [earned 5 cycles]
View Answer
xfinnbar (134)

You need to listen on instead of localhost.

Socked (0)

@xfinnbar I found the solution myself, but how do I do that on replit? Just curious.


// use
// instead of just
xfinnbar (134)

Not a Node guy myself, but in Python Flask you use"") @Socked

Socked (0)

Ohh, I’ve never used Python at all. In Node I just do

app.listen(3000,()=>{console.log(`I’M AWAKE`)})


xfinnbar (134)

Node must listen on by default. In Python and a lot of other languages, localhost is default. @Socked