Spaces:
Runtime error
Runtime error
Testing CORS regex
Browse files- TextGen/__init__.py +2 -2
TextGen/__init__.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
|
| 4 |
-
app = FastAPI(title="Deploying FastAPI Apps on Huggingface")
|
| 5 |
app.add_middleware(
|
| 6 |
CORSMiddleware,
|
| 7 |
-
allow_origins=[
|
|
|
|
| 8 |
allow_credentials=True,
|
| 9 |
allow_methods=["*"],
|
| 10 |
allow_headers=["*"],
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
|
|
|
|
| 4 |
app.add_middleware(
|
| 5 |
CORSMiddleware,
|
| 6 |
+
allow_origins=[],
|
| 7 |
+
allow_origin_regex=r"^https://jofthomas-.*\.hf\.space$",
|
| 8 |
allow_credentials=True,
|
| 9 |
allow_methods=["*"],
|
| 10 |
allow_headers=["*"],
|