fastapi-demo / main.py
dotku's picture
Update main.py
f52fad2
raw
history blame contribute delete
320 Bytes
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=['*']
)
@app.get("/")
def read_root():
return {"message": "Hello World"}
@app.get("/api/python")
def hello_python():
return {"message": "Hello Python"}