randydev commited on
Commit
92b5cba
·
verified ·
1 Parent(s): 7f59fb5
Files changed (1) hide show
  1. main.py +12 -2
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 akenoai.middleware.cors import CORSMiddleware
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
- js.add_cors_middleware()
 
 
 
 
 
 
 
 
 
 
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