Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Why should bottlepy stick to a file?. Parent comment
test.py ======= import bottle @bottle.get('/') def index(): return 'INDEX' # a new wsgi app hello = bottle.Bottle() @hello.get('/<name>') def greet(name): return 'Hello, ' + name bottle.app().mount('/hello', hello)
You should have 2 working routes, "/" and "/hello/<name>".
But I'm still not clear on how I require "example.py" and mount it (ie how do I make an wsgi instance from a python file that is a bottle app)?
You should have 2 working routes, "/" and "/hello/<name>".