Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,14 @@ from pydantic import BaseModel
|
|
| 7 |
|
| 8 |
app = FastAPI(title="ChatGPT OS Key Faucet")
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# --- CONFIGURATION ---
|
| 11 |
TARGET_SPACE_URL = "https://coollamaceo-chatgptopensource1-0.hf.space/chat"
|
| 12 |
DB_PATH = "/data/keys.db" if os.path.exists("/data") else "keys.db"
|
|
|
|
| 7 |
|
| 8 |
app = FastAPI(title="ChatGPT OS Key Faucet")
|
| 9 |
|
| 10 |
+
app.add_middleware(
|
| 11 |
+
CORSMiddleware,
|
| 12 |
+
allow_origins=["*"], # Allows all origins
|
| 13 |
+
allow_credentials=True,
|
| 14 |
+
allow_methods=["*"], # Allows all methods (GET, POST, PUT, DELETE, etc.)
|
| 15 |
+
allow_headers=["*"], # Allows all headers
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
# --- CONFIGURATION ---
|
| 19 |
TARGET_SPACE_URL = "https://coollamaceo-chatgptopensource1-0.hf.space/chat"
|
| 20 |
DB_PATH = "/data/keys.db" if os.path.exists("/data") else "keys.db"
|