How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

后端 未结 13 1312
时光取名叫无心
时光取名叫无心 2020-11-30 17:36

I am new to the whole nodejs/reactjs world so apologies if my question sounds silly. So I am playing around with reactabular.js.

Wh

13条回答
  •  情书的邮戳
    2020-11-30 17:53

    For me: changing the listen host worked:

    .listen(3000, 'localhost', function (err, result) {
            if (err) {
                console.log(err);
            }
            console.log('Listening at localhost:3000');
        });
    

    was changed to :

    .listen(3000, '0.0.0.0', function (err, result) {
            if (err) {
                console.log(err);
            }
            console.log('Listening at localhost:3000');
        });
    

    and the server started listening on 0.0.0.0

提交回复
热议问题