Fix route arg; update regex

Fixed a potential "copy/paste" error in the `person_handler`. Simplify route regex.
This commit is contained in:
C. Bess 2016-10-15 13:03:05 -05:00 committed by GitHub
parent 1d519ff407
commit 8cade2f664

View File

@ -21,11 +21,11 @@ async def person_handler(request, integer_arg):
async def person_handler(request, number_arg): async def person_handler(request, number_arg):
return text('Number - {}'.format(number)) return text('Number - {}'.format(number))
@app.route('/person/<name:[A-Za-z]>') @app.route('/person/<name:[A-z]>')
async def person_handler(request, person_id): async def person_handler(request, name):
return text('Person - {}'.format(folder_id)) return text('Person - {}'.format(name))
@app.route('/folder/<folder_id:[A-Za-z0-9]{0,4}>') @app.route('/folder/<folder_id:[A-z0-9]{0,4}>')
async def folder_handler(request, folder_id): async def folder_handler(request, folder_id):
return text('Folder - {}'.format(folder_id)) return text('Folder - {}'.format(folder_id))