How to change eve's IP address?

2019-07-10 03:27发布

问题:

When I run the api.py the default IP address is 127.0.0.1:5000 which is the local host. I am running the eve scripts on the server side. Am I able to change that IP address to server's address? or Am I just access it using server's address.

For example, if the server's address is 11.5.254.12, then I run the api.py. Am I able to access it outside of the server using 11.5.254.12:5000 or is there any way to change it from 127.0.0.1 to 11.5.254.12?

回答1:

Add a parameter to your app.run(). By default it runs on localhost, change it to app.run(host= '0.0.0.0') to run on your machine IP address.