2022-06-04 16:01:23 +03:00
|
|
|
import os
|
|
|
|
|
|
|
|
from django.core.asgi import get_asgi_application
|
2022-06-21 11:36:55 +03:00
|
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
2022-06-04 16:01:23 +03:00
|
|
|
|
2022-06-21 11:36:55 +03:00
|
|
|
import room.routing
|
2022-06-21 20:26:32 +03:00
|
|
|
from room.middleware import HeaderAuthMiddleware
|
2022-06-04 16:01:23 +03:00
|
|
|
|
2022-06-21 11:36:55 +03:00
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chess_backend.settings")
|
|
|
|
|
|
|
|
application = ProtocolTypeRouter(
|
|
|
|
{
|
|
|
|
"http": get_asgi_application(),
|
2022-06-21 20:26:32 +03:00
|
|
|
"websocket": HeaderAuthMiddleware(
|
|
|
|
URLRouter(room.routing.websocket_urlpatterns)
|
2022-06-21 11:36:55 +03:00
|
|
|
),
|
|
|
|
}
|
|
|
|
)
|