aboutsummaryrefslogtreecommitdiffstats
path: root/thallium-backend/src
diff options
context:
space:
mode:
Diffstat (limited to 'thallium-backend/src')
-rw-r--r--thallium-backend/src/app.py2
-rw-r--r--thallium-backend/src/routes/__init__.py2
-rw-r--r--thallium-backend/src/routes/debug.py7
-rw-r--r--thallium-backend/src/settings.py2
4 files changed, 11 insertions, 2 deletions
diff --git a/thallium-backend/src/app.py b/thallium-backend/src/app.py
index 5907348..6060ec3 100644
--- a/thallium-backend/src/app.py
+++ b/thallium-backend/src/app.py
@@ -9,7 +9,7 @@ from src.settings import CONFIG
log = logging.getLogger(__name__)
-fastapi_app = FastAPI(debug=CONFIG.debug)
+fastapi_app = FastAPI(debug=CONFIG.debug, root_path=CONFIG.app_prefix)
fastapi_app.include_router(top_level_router)
diff --git a/thallium-backend/src/routes/__init__.py b/thallium-backend/src/routes/__init__.py
index b321e52..afa02af 100644
--- a/thallium-backend/src/routes/__init__.py
+++ b/thallium-backend/src/routes/__init__.py
@@ -3,6 +3,6 @@ from fastapi import APIRouter
from src.routes.debug import router as debug_router
from src.settings import CONFIG
-top_level_router = APIRouter(prefix="/api")
+top_level_router = APIRouter()
if CONFIG.debug:
top_level_router.include_router(debug_router)
diff --git a/thallium-backend/src/routes/debug.py b/thallium-backend/src/routes/debug.py
index 7fe42da..fac40d7 100644
--- a/thallium-backend/src/routes/debug.py
+++ b/thallium-backend/src/routes/debug.py
@@ -15,6 +15,13 @@ async def get_templates(client: PrintfulClient) -> dict:
return resp.json()
[email protected]("/variants/{variant_id}")
+async def get_variant(client: PrintfulClient, variant_id: int) -> dict:
+ """Return all templates in printful."""
+ resp = await client.get(f"/products/variant/{variant_id}")
+ return resp.json()
+
+
@router.get("/oauth-scopes-v1")
async def get_oauth_scopes(client: PrintfulClient) -> dict:
"""Return all templates in printful."""
diff --git a/thallium-backend/src/settings.py b/thallium-backend/src/settings.py
index db292ba..f6e144c 100644
--- a/thallium-backend/src/settings.py
+++ b/thallium-backend/src/settings.py
@@ -28,6 +28,8 @@ class _Config(
super_admin_token: pydantic.SecretStr
printful_token: pydantic.SecretStr
+ app_prefix: str = "/"
+
CONFIG = _Config()