Add basic vue app
This commit is contained in:
parent
68e2137ef4
commit
69e7cf3f3b
44 changed files with 3530 additions and 1217 deletions
15
api/index.py
15
api/index.py
|
|
@ -1,10 +1,25 @@
|
|||
from dotenv import dotenv_values
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from api.db.engine import engine
|
||||
|
||||
config = dotenv_values(".env")
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
origins = ["http://localhost", config["VITE_APP_URL"]]
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
@app.get("/api/python")
|
||||
def hello_world():
|
||||
return {"message": "Hello World"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue