
import os
from eve import Eve

if __name__ == '__main__':
    # Heroku support: bind to PORT if defined, otherwise default to 5000.
    if 'PORT' in os.environ:
        port = int(os.environ.get('PORT'))
        host = '0.0.0.0'
    else:
        port = 5000
        host = '127.0.0.1'

    app = Eve()
    app.run(host=host, port=port)


import os
from eve import Eve

if __name__ == '__main__':
    # Heroku support: bind to PORT if defined, otherwise default to 5000.
    if 'PORT' in os.environ:
        port = int(os.environ.get('PORT'))
        # use '0.0.0.0' to ensure your REST API is reachable from all your
        # network (and not only your computer).
        host = '0.0.0.0'
    else:
        port = 5000
        host = '127.0.0.1'

    app = Eve()
    app.run(host=host, port=port)

Use '0.0.0.0' to ensure your API is reachable outside localhost.
Use '0.0.0.0' to ensure your API is reachable outside localhost.

  
  import os
  from eve import Eve
  
  if __name__ == '__main__':
      # Heroku support: bind to PORT if defined, otherwise default to 5000.
      if 'PORT' in os.environ:
          port = int(os.environ.get('PORT'))
+         # use '0.0.0.0' to ensure your REST API is reachable from all your
+         # network (and not only your computer).
          host = '0.0.0.0'
      else:
          port = 5000
          host = '127.0.0.1'
  
      app = Eve()
      app.run(host=host, port=port)
  
Use '0.0.0.0' to ensure your API is reachable outside localhost.
## Code Before:

import os
from eve import Eve

if __name__ == '__main__':
    # Heroku support: bind to PORT if defined, otherwise default to 5000.
    if 'PORT' in os.environ:
        port = int(os.environ.get('PORT'))
        host = '0.0.0.0'
    else:
        port = 5000
        host = '127.0.0.1'

    app = Eve()
    app.run(host=host, port=port)

## Instruction:
Use '0.0.0.0' to ensure your API is reachable outside localhost.
## Code After:

import os
from eve import Eve

if __name__ == '__main__':
    # Heroku support: bind to PORT if defined, otherwise default to 5000.
    if 'PORT' in os.environ:
        port = int(os.environ.get('PORT'))
        # use '0.0.0.0' to ensure your REST API is reachable from all your
        # network (and not only your computer).
        host = '0.0.0.0'
    else:
        port = 5000
        host = '127.0.0.1'

    app = Eve()
    app.run(host=host, port=port)
