Skip to content

Commit

Permalink
move init_db() from __init__.py to app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
samj committed Aug 13, 2024
1 parent 67034f5 commit 451c30d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# backend package
import os
from common import paths
from backend.db import init_db

# List of directories to ensure exist
required_directories = [
Expand All @@ -13,5 +12,3 @@
if not os.path.exists(directory):
os.makedirs(directory)

# Initialize the database
init_db()
4 changes: 4 additions & 0 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
from connexion.resolver import MethodResolver
from connexion.middleware import MiddlewarePosition
from starlette.middleware.cors import CORSMiddleware
from backend.db import init_db

def create_backend_app():
# Initialize the database
init_db()

apis_dir = Path(__file__).parent.parent / 'apis' / 'paios'
connexion_app = AsyncApp(__name__, specification_dir=apis_dir)

Expand Down

0 comments on commit 451c30d

Please sign in to comment.