We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20556a6 commit d01834bCopy full SHA for d01834b
1 file changed
src/api/api.py
@@ -1,5 +1,6 @@
1
from fastapi import FastAPI
2
from pydantic import BaseModel
3
+from fastapi.middleware.cors import CORSMiddleware
4
5
6
class URL(BaseModel):
@@ -20,6 +21,11 @@ def __init__(self, db_manager):
20
21
version=self.version,
22
description=self.description
23
)
24
+ self.app.add_middleware(
25
+ CORSMiddleware,
26
+ allow_origins=["*"], # разрешить все домены
27
+ allow_credentials=True,
28
+ )
29
self._setup_routes()
30
31
def run(self, listen_on: URL):
0 commit comments