Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| app = FastAPI() | |
| origins = ['http://localhost:3000', 'http://127.0.0.1:3000', | |
| 'https://localhost:3000', 'https://127.0.0.1:3000'] | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=['*'] | |
| ) | |
| def read_root(): | |
| return {"message": "Hello World"} | |
| def hello_python(): | |
| return {"message": "Hello Python"} |