31 lines
646 B
Python
31 lines
646 B
Python
|
|
from fastapi import FastAPI
|
||
|
|
from fastapi.middleware.cors import CORSMiddleware
|
||
|
|
from routes import router as quote_router
|
||
|
|
|
||
|
|
|
||
|
|
app = FastAPI(
|
||
|
|
title="Quote Manager",
|
||
|
|
description="Quote Manager",
|
||
|
|
version="1.0.0",
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
origins = [
|
||
|
|
"http://localhost:5173",
|
||
|
|
"http://localhost:5173",
|
||
|
|
]
|
||
|
|
|
||
|
|
app.add_middleware(
|
||
|
|
CORSMiddleware,
|
||
|
|
allow_origins=origins,
|
||
|
|
allow_credentials=True,
|
||
|
|
allow_methods=["*"],
|
||
|
|
allow_headers=["*"],
|
||
|
|
)
|
||
|
|
|
||
|
|
# router for quote management
|
||
|
|
app.include_router(quote_router, prefix="/api/quotes")
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
import uvicorn
|
||
|
|
uvicorn.run(app, host="0.0.0.0", port=8000, reload=True)
|