Reputation: 141
I am building a web app using Node and express. On my PC, I run the app by typing node app.js
which gets the server running on http://localhost:1008/
On my android phone, which is connected to the same network, I typed
http://<ipv4 address>:1008/
but it doesn't work.
The wifi network is set to private(home) and i tried turning off firewall, but still it doesn't work
I am using Windows 7 PC.
My app (just a test app)
const express = require('express')
const app = express()
app.set('view engine','ejs')
app.get("/",(req,res)=>{
res.render('home')
})
app.get("/about",(req,res)=>{
res.render("about")
})
app.listen(3000,()=>{console.log("server running on port 3000"})
Any help is appreciated
Upvotes: 1
Views: 1701
Reputation: 1248
There are several possibilities that you are not able to access your node server on other devices,
Solution for above problems is,
Upvotes: 1