Skip to content

Commit

Permalink
Create main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
christianlouis authored Feb 9, 2025
1 parent 454e0a2 commit da3a180
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3

from fastapi import FastAPI, Depends
from .config import settings
from .database import engine, SessionLocal
from .models import Base
from .tasks import process_document

app = FastAPI(title="Document Processor")

# Initialize database
Base.metadata.create_all(bind=engine)

@app.get("/")
def root():
return {"message": "Document Processing API"}

@app.post("/process/")
def process(file_path: str):
"""Trigger document processing"""
task = process_document.delay(file_path)
return {"task_id": task.id, "status": "queued"}

0 comments on commit da3a180

Please sign in to comment.