I have been trying to run a simple node.js server using express from WSL2 at port 3000
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('<h1>Hello World</h1>');
});
app.listen(3000, () => {
console.log('Run at http://localhost:3000');
});
I can connect from in my computer's browser and see the 'Hello World' but I'm not able to connect from a external device's browser (My phone,etc...) i put my windows ip both wsl2 ip , but none works
also i tried to set a host in '0.0.0.0' like this but it didn't work either
app.listen(3000, '0.0.0.0', () => {
console.log('Run at http://localhost:3000');
});
When i try to run the same server but using git bash in my windows everything works alright...
Any suggestions ?
I'd appreciate your help!