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 typedhttp://<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
There are several possibilities that you are not able to access your node server on other devices,
Solution for above problems is,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.