I'd like to run a site and a dedicated url shortener on the same instance of web2py. These are two different apps (let's call them MainApp and Short) corresponding to two different domains (let's say,
mainapp.com and
short.me). I've managed to set up my routes.conf and routes.py file such that things seem to be routing properly. However, I'd like to be able to pass strings of numbers as arguments to the Short app's default/index function in this way: "
short.me/[some number]"; I'm not quite sure how to set up the routes file to accomplish this. Can somebody suggest modifications to the routes files that would permit passing numerical arguments? Thanks.
The Short app's default function looks like this:
def index():
redirect(URL('default', 'redirect', scheme='http', host='mainapp.com',
vars = dict(id = request.args(0))))