File size: 811 Bytes
ade0ea8
d82c1af
ade0ea8
d82c1af
 
b7b3667
e0a400b
d82c1af
 
 
 
 
e0a400b
ade0ea8
 
 
 
 
 
 
 
e0a400b
d82c1af
 
b7b3667
ade0ea8
 
 
 
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
28
29
# main.py
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from dotenv import load_dotenv
from routers.llm_chat import router as llm_chat_router
from routers.scraping_router import router as scraping_router

app = FastAPI(
    title="LLM Chat API",
    description="A FastAPI application to interact with an external LLM API.",
    version="1.0.0",
)

# Enable CORS for all origins
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # Allows all origins
    allow_credentials=True,
    allow_methods=["*"],  # Allows all methods
    allow_headers=["*"],  # Allows all headers
)

# Include the router
app.include_router(llm_chat_router)
app.include_router(scraping_router)

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)