Merge pull request #1 from AndrewLaneX/filename-param
Add an optional filename URL parameter
This commit is contained in:
@@ -90,7 +90,8 @@ def new():
|
|||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
@flask_app.route('/<nid>', methods=['GET'])
|
@flask_app.route('/<nid>', methods=['GET'])
|
||||||
def get(nid):
|
@flask_app.route('/<nid>/<filename>', methods=['GET'])
|
||||||
|
def get(nid, filename=None):
|
||||||
try:
|
try:
|
||||||
with shelve.open(DB) as db:
|
with shelve.open(DB) as db:
|
||||||
return db[nid] + '\n', 200, {'Content-Type': 'text/plain; charset=utf-8'}
|
return db[nid] + '\n', 200, {'Content-Type': 'text/plain; charset=utf-8'}
|
||||||
|
|||||||
Reference in New Issue
Block a user