Skip to content

Instantly share code, notes, and snippets.

@Audhil
Last active November 15, 2020 10:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Audhil/0570c90fa9dc56b0e67b1f9cfd6b6d98 to your computer and use it in GitHub Desktop.
Save Audhil/0570c90fa9dc56b0e67b1f9cfd6b6d98 to your computer and use it in GitHub Desktop.
# development way
if __name__ == '__main__':
app.run()
## server on http://127.0.0.1:5000/
## (invisible across the network) won't work on other device, other than development machine
# suggested way
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
## server on http://0.0.0.0:5000/
## visible across the network
## BaseUrl for Android http://<your ip address>:5000/blah/blah
# hackiest way (not preferred)
if __name__ == '__main__':
app.run(host='<your ip address>')
## server on http://<your ip address>:5000/
## visible across the network
## BaseUrl for Android http://<your ip address>:5000/blah/blah
## whereas port=5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment