I'm using Eve to create a REST API for MongoDB. It's all working fine, except for the fact that I can't reach the API from any other computer (in the same network), or even a different URL (e.g.: if I set SERVER_NAME = 'localhost:29000', I will not be able to reach the API with 127.0.0.1 and vice versa).
I've been looking around for hours, and I can't seem to find an answer. I also tried other REST API's for MongoDB like Kule, and they seem to work just fine, but they don't have as many options as Eve has.
0.0.0.0
instead of127.0.0.1
- the former means "all interfaces", the latter will bind it on localhost only. – PapalSERVER_NAME
seems to be based on the configuration variable by the same name from Flask: See "More on server name" below the table in the Flask Configuration docs. So it's really just for the name (hostname / subdomain handling) - the actual network interfaces it binds to therfore are probably determined by the server that runs the WSGI application. How are you serving your application? – Papalapp = Eve(); app.run()
from the quickstart example, tryapp.run(host='0.0.0.0')
and leave the server name empty (SERVER_NAME = ''
) - I've never used Eve, but from what I understand about how its built that should work. – Papal