Skip to content

Commit 6901836

Browse files
committed
Support root path
1 parent 58652e4 commit 6901836

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
class Settings(BaseSettings):
55
anthropic_api_key: str
6+
root_path: str = ""
67
model_config = SettingsConfigDict(env_file=".env")
78

89

app/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
logger = logging.getLogger()
1010
logger.setLevel(logging.INFO)
1111

12-
app = FastAPI()
12+
# TODO consider https://github.com/FanchenBao/fastapi_lambda_api-gateway_sample/blob/main/app/main.py for CORS
13+
app = FastAPI(root_path=settings.root_path)
1314
handler = Mangum(app)
1415

1516
anthropic_client = Anthropic(api_key=settings.anthropic_api_key)

0 commit comments

Comments
 (0)