17 lines
351 B
Python
17 lines
351 B
Python
import os
|
|
import sqlite3
|
|
|
|
from backend.adapters.sqlite import create_db
|
|
|
|
|
|
def sqlite_conn(sqlite_file: str = ":memory"):
|
|
conn = sqlite3.connect(sqlite_file)
|
|
create_db(conn)
|
|
return conn
|
|
|
|
|
|
def get_api_url():
|
|
host = os.environ.get("API_HOST", "localhost")
|
|
port = 8000 if host == "localhost" else 80
|
|
return f"http://{host}:{port}"
|