main.py
CHANGED
@@ -9,7 +9,7 @@ from akenoai import OldAkenoXToJs
|
|
9 |
from akenoai.runner import run_fast
|
10 |
from akenoai.clients import create_pyrogram
|
11 |
from akenoai.clients.enums import ChatMembersFilter
|
12 |
-
from
|
13 |
|
14 |
from pyrogram.enums import *
|
15 |
from pyrogram.errors import *
|
@@ -26,7 +26,17 @@ logger.setLevel(logging.DEBUG)
|
|
26 |
|
27 |
js = OldAkenoXToJs()
|
28 |
fast_app = js.get_app()
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
import uvloop
|
32 |
|
|
|
9 |
from akenoai.runner import run_fast
|
10 |
from akenoai.clients import create_pyrogram
|
11 |
from akenoai.clients.enums import ChatMembersFilter
|
12 |
+
from fastapi.middleware.cors import CORSMiddleware
|
13 |
|
14 |
from pyrogram.enums import *
|
15 |
from pyrogram.errors import *
|
|
|
26 |
|
27 |
js = OldAkenoXToJs()
|
28 |
fast_app = js.get_app()
|
29 |
+
|
30 |
+
origins = [
|
31 |
+
"https://randydev-meta-ai.hf.space"
|
32 |
+
]
|
33 |
+
fast_app.add_middleware(
|
34 |
+
CORSMiddleware,
|
35 |
+
allow_origins=origins,
|
36 |
+
allow_credentials=True,
|
37 |
+
allow_methods=["*"],
|
38 |
+
allow_headers=["*"],
|
39 |
+
)
|
40 |
|
41 |
import uvloop
|
42 |
|