File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed
Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,6 @@ GATEWAY_KEY_TTL=2
3636RABBITMQ_URL = amqp://guest:guest@localhost:5672/
3737
3838QUEUE_SECRECT_KEY = ' XXXXXXXXXXXXXXXXX'
39- QUEUE_SECRECT_KEY_TTL = 0.5
39+ QUEUE_SECRECT_KEY_TTL = 0.5
40+
41+ CORS_ALLOWED_ORIGINS = http://localhost:3000, ...
Original file line number Diff line number Diff line change 1+ from src .env import cors
2+
3+ CORS_ALLOWED_ORIGINS = cors ["allowed_origins" ]
Original file line number Diff line number Diff line change 11from src .env import app
22
33from .apps import INSTALLED_APPS as INSTALLED_APPS
4+ from .cors import CORS_ALLOWED_ORIGINS as CORS_ALLOWED_ORIGINS
45from .caches import CACHES as CACHES
56from .logger import LOGGING as LOGGING
67from .databases import DATABASES as DATABASES
Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ class Queue(TypedDict):
6464 ttl : float
6565
6666
67+ class CORS (TypedDict ):
68+ allowed_origins : list [str ]
69+
70+
6771env = Env ()
6872
6973app : App = {
@@ -126,11 +130,14 @@ class Queue(TypedDict):
126130
127131rabbitmq_config : RabbitMQ = {"url" : get_env_str ("RABBITMQ_URL" )}
128132
133+ cors : CORS = {"allowed_origins" : get_env_list ("CORS_ALLOWED_ORIGINS" )}
134+
129135
130136__all__ = [
131137 "api_gateway" ,
132138 "app" ,
133139 "cache" ,
140+ "cors" ,
134141 "db" ,
135142 "env" ,
136143 "jwt_config" ,
You can’t perform that action at this time.
0 commit comments