Skip to content

Instantly share code, notes, and snippets.

@dannystaple
Created October 28, 2011 16:34
Show Gist options
  • Save dannystaple/1322703 to your computer and use it in GitHub Desktop.
Save dannystaple/1322703 to your computer and use it in GitHub Desktop.
Simple bottle example
from bottle import *
@route("/test")
def test():
return "<h1>Hello!</h1>"
run(host = "localhost", port=8100)
Bottle server starting up (using WSGIRefServer())...
Listening on http://localhost:8100/
Use Ctrl-C to quit.
@dannystaple
Copy link
Author

This example will only listen on localhost. This is not a firewall problem. To make it listen on all interfaces, the host should be set to "0.0.0.0". Take a look closely at the host param at http://bottlepy.org/docs/dev/api.html#module-contents for detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment