fix(billing): auto-detect repo root for shared module import in local dev

This commit is contained in:
Roberto Musso
2026-04-06 23:32:17 +02:00
parent 57b5648915
commit 48036397f1

View File

@@ -11,9 +11,16 @@ The webhook endpoint is exposed WITHOUT ForwardAuth so Stripe can reach it.
from __future__ import annotations
import logging
import sys
from contextlib import asynccontextmanager
from pathlib import Path
from typing import AsyncGenerator
# Ensure the repo root is on sys.path so "shared" is importable in local dev.
_repo_root = str(Path(__file__).resolve().parents[3])
if _repo_root not in sys.path:
sys.path.insert(0, _repo_root)
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware