v1
This commit is contained in:
35
server/app.py
Normal file
35
server/app.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Compatibility layer exposing the Flask app instance."""
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from .database import (
|
||||
DB_PATH as _DB_PATH,
|
||||
DEFAULT_DB_PATH,
|
||||
db_cursor,
|
||||
init_db as _init_db,
|
||||
is_postgres_enabled,
|
||||
set_db_path,
|
||||
set_postgres_override,
|
||||
)
|
||||
from .factory import create_app
|
||||
|
||||
app = create_app()
|
||||
DB_PATH: Path = _DB_PATH
|
||||
|
||||
|
||||
def init_db() -> None:
|
||||
"""Initialise the database using the current DB_PATH."""
|
||||
set_db_path(DB_PATH)
|
||||
_init_db()
|
||||
|
||||
|
||||
__all__ = [
|
||||
"app",
|
||||
"DB_PATH",
|
||||
"DEFAULT_DB_PATH",
|
||||
"db_cursor",
|
||||
"init_db",
|
||||
"is_postgres_enabled",
|
||||
"set_postgres_override",
|
||||
]
|
||||
Reference in New Issue
Block a user