-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (21 loc) · 768 Bytes
/
main.py
File metadata and controls
27 lines (21 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fastapi import FastAPI
from catalog.api.routes import config_router, catalog_router
import uvicorn
import os
app = FastAPI(
title="Python Iceberg REST Catalog",
description="A Python-based Apache Iceberg REST Catalog implementation.",
version="0.1.0",
)
# Mount config router (global)
app.include_router(config_router)
# Mount config router with prefix support so clients can call /v1/{prefix}/config
app.include_router(config_router, prefix="/v1/{prefix}")
# Mount catalog router with prefix support
# 1. Support /v1/{prefix}/...
app.include_router(catalog_router, prefix="/v1/{prefix}")
# 2. Support /v1/... (no prefix)
app.include_router(catalog_router, prefix="/v1")
@app.get("/health")
async def health_check():
return {"status": "ok"}