Skip to content

Commit

Permalink
Documenting changed api
Browse files Browse the repository at this point in the history
  • Loading branch information
defnull committed Jun 30, 2009
1 parent c78437f commit 6a6995f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,23 @@ Features
Example
-------

from bottle import route, run
from bottle import route, run, request, response

@route('/')
def hello_world(request):
def hello_world():
return 'Hello World!'

@route('/hello/:name')
def hello_name(request, name):
def hello_name(name):
return 'Hello %s!' % name

@route('/hello', method='POST')
def hello_post(request):
def hello_post():
return 'Hello %s!' % request.POST['name']

@route('/static/:filename#.*#')
def static_file(request, filename):
# On failure, this automatically raises NotFoundError or AccessError
raise SendFile(filename, root='/path/to/static/files/')
def static_file(filename):
response.send_file(filename, root='/path/to/static/files/')

run(host='localhost', port=8080)

Expand Down

0 comments on commit 6a6995f

Please sign in to comment.