Add an optional filename URL parameter

This commit is contained in:
Andrew Lane
2020-08-20 16:15:35 -04:00
parent 94f4539242
commit 6436454003
+2 -1
View File
@@ -90,7 +90,8 @@ def new():
abort(400)
@flask_app.route('/<nid>', methods=['GET'])
def get(nid):
@flask_app.route('/<nid>/<filename>', methods=['GET'])
def get(nid, filename=None):
try:
with shelve.open(DB) as db:
return db[nid] + '\n', 200, {'Content-Type': 'text/plain; charset=utf-8'}