You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
597 B

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from settings import Settings
import os
settings = Settings(_env_file=os.getenv("ENV", ".env"))
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/")
async def get_greeting():
return "hello"
if __name__ == "__main__":
import uvicorn
uvicorn.run(
app,
host = settings.uvicorn.host,
port = settings.uvicorn.port,
reload= settings.uvicorn.reload
)