json-server cannot access via local IP

前端 未结 5 1097
盖世英雄少女心
盖世英雄少女心 2020-12-13 20:31

I\'m using npm json-server from here. It used to work great for my needs: run a server on my PC and do GET requests to local IP (192.168.1.XX). I r

5条回答
  •  渐次进展
    2020-12-13 21:18

    Another option that worked for me:

    json-server -H 0.0.0.0 -p 3000 -w db.json
    

    Note: You need to enable port 3000 for TCP/UDP through firewall though. Something like this

    sudo ufw allow 3000
    

提交回复
热议问题