@app.route("<STR_LIT>")<EOL>@requires_auth<EOL>def serve_image(image_id):
try:<EOL><INDENT>preview_dir = config()['<STR_LIT>']['<STR_LIT>']<EOL>filepath = config()['<STR_LIT>']['<STR_LIT>'][image_id]<EOL>filepath = filepath.replace('<STR_LIT>', preview_dir)<EOL>filepath = os.path.abspath(filepath)<EOL>if os.path.isfile(filepath):<EOL><INDENT>directory, filename = filepath.rsplit('<STR_LIT:/>', <NUM_LIT:1>)<EOL>return send_from_directory(directory, filename)<EOL><DEDENT><DEDENT>except (IndexError, KeyError):<EOL><INDENT>pass<EOL><DEDENT>return '<STR_LIT>', <NUM_LIT><EOL>
Serve the preview image with the given id