Bind rails server to 127.0.0.1 by default

前端 未结 4 881
长发绾君心
长发绾君心 2021-02-19 01:09

I\'d like to bind the rails server to 127.0.0.1, instead of 0.0.0.0 so its not accessible when I\'m working from coffee shops.

Is there a configuration file where I can

4条回答
  •  再見小時候
    2021-02-19 01:49

    You can make a bash script to just run the command by default:

    #!/bin/bash
    rails server -b 127.0.0.1
    

    Put it in the same folder as your project, name it anything you want (e.g. devserv), then

    chmod +x devserv
    

    And all you have to do is ./devserv

提交回复
热议问题