diff --git a/rxsmserver/__init__.py b/rxsmserver/__init__.py index e91ec64..0d1d863 100644 --- a/rxsmserver/__init__.py +++ b/rxsmserver/__init__.py @@ -1,5 +1,5 @@ # Created 2019-09-10 by NGnius -from flask import Flask, Blueprint, jsonify, request +from flask import Flask, Blueprint, jsonify, request, send_file import sqlite3 as dblib from hashlib import sha512 from os import getcwd @@ -48,6 +48,10 @@ def create_or_modify_release(): return jsonify({'status':200, 'reason':'Version %s %sd successfully' % (version, operation)}), 200 +@app.route('/database', methods=['GET']) +def download_database(): + return send_file(database_path, cache_timeout=1, as_attachment=True, attachment_filename="rxsm.sqlite") + # always try to create db table(s) conn = get_or_create_connection() cursor = conn.cursor()