How to set up a server that others on my work network can access using node.js? -


i'm new node.js, i've created server 2 ways.

one way this:

server.js:

var connect = require("connect"); var servestatic = require("serve-static"); connect().use(servestatic(__dirname)).listen(8080); 

node.js cmd line:

h:\> npm install connect serve-static h:\> node server.js 

and other way this

h:\> npm install http-server -g http-server "c:\directory" 

but these create servers on computer @ http://localhost:8080. how can adjust code make server accessible other people on work network?

thanks in advance.

the server accessible network already. use ip address or real hostname.

http://203.0.113.1:8080/ 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -