comparison love/poppy/main.py @ 38:cf9caa4abc3e

[Love] FE and BE. Can chat and render images. Also created MCP for powerpoint generations.
author MrJuneJune <me@mrjunejune.com>
date Mon, 01 Dec 2025 20:35:56 -0800
parents
children
comparison
equal deleted inserted replaced
37:fb9bcd3145cb 38:cf9caa4abc3e
1 # main.py
2 from fastapi import FastAPI
3 from fastapi.middleware.cors import CORSMiddleware
4 import uvicorn
5
6 from utils.database import create_db_and_tables
7 from apis.router import router
8
9 app = FastAPI(
10 title="Talk to Epi Chan",
11 version="0.1.0",
12 description="This is for fun",
13 )
14
15 app.add_middleware(
16 CORSMiddleware,
17 allow_origins=[
18 "http://localhost:5173",
19 "https://epi.babocoder.com",
20 ],
21 allow_credentials=True,
22 allow_methods=["*"],
23 allow_headers=["*"],
24 )
25
26 app.include_router(router)
27
28
29 @app.on_event("startup")
30 async def startup():
31 create_db_and_tables()
32
33
34 if __name__ == "__main__":
35 uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)