from fastapi import FastAPI from fastapi.responses import HTMLResponse import os app = FastAPI() @app.get("/") async def root(): """Simple hello world endpoint""" return { "message": "Hello World from MinerU PDF Converter!", "status": "running", "environment": os.environ.get("SPACE_ID", "local") } @app.get("/health") async def health_check(): """Health check endpoint""" return {"status": "healthy", "service": "pdf2md"} @app.get("/test", response_class=HTMLResponse) async def test_page(): """Simple HTML test page""" return """
This is a test deployment. Full functionality coming soon.
""" @app.get("/api/info") async def api_info(): """API information endpoint""" return { "name": "PDF to Markdown Converter API", "version": "0.1.0", "endpoints": { "/": "Main endpoint", "/health": "Health check", "/test": "Test HTML page", "/docs": "FastAPI automatic documentation", "/api/info": "This endpoint" } }