Skip to content

Commit 39e2bb5

Browse files
committed
typ app.py
1 parent 2352ce4 commit 39e2bb5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/opengeodeweb_back/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ def errorhandler(e: HTTPException) -> tuple[dict[str, Any], int] | Response:
6666
"/error",
6767
methods=["POST"],
6868
)
69-
def return_error() -> None:
69+
def return_error() -> Response:
7070
flask.abort(500, f"Test")
71+
return flask.make_response({}, 500)
7172

7273

7374
@app.route("/", methods=["POST"])
@@ -142,7 +143,9 @@ def run_server() -> None:
142143
db_filename: str = app.config.get("DATABASE_FILENAME") or "database.db"
143144
db_path = os.path.join(args.data_folder_path, db_filename)
144145
os.makedirs(os.path.dirname(db_path), exist_ok=True)
145-
init_database(db_path)
146+
app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite:///{db_path}"
147+
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
148+
init_database(app, db_filename)
146149
print(f"Database initialized at: {db_path}", flush=True)
147150

148151
app.run(debug=args.debug, host=args.host, port=args.port, ssl_context=SSL)

0 commit comments

Comments
 (0)