How could others, on a local network, access my NodeJS app while it's running on my machine?

后端 未结 15 1665
旧时难觅i
旧时难觅i 2020-12-02 07:55

I have a pretty straight-forward question. I made a web game with NodeJS, and I can successfully play it by myself with multiple browser windows open side-by-side; however,

15条回答
  •  攒了一身酷
    2020-12-02 08:16

    var http = require('http');
    http.createServer(function (req, res) {
    }).listen(80, '127.0.0.1');
    console.log('Server running at http://127.0.0.1:80/');
    

提交回复
热议问题