- Move Service Worker to root (/sw.js) for proper scope registration - Add route to serve sw.js from root with correct content-type - Update push-notifications.js to register sw.js from root - Fix all notification API URLs to use /api/v1/ prefix - Update notificationsApi.js to use correct v1 endpoints
23 lines
1.3 KiB
Python
23 lines
1.3 KiB
Python
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
from django.views.static import serve
|
|
import os
|
|
|
|
urlpatterns = [
|
|
path("admin/", admin.site.urls),
|
|
path("auth/", include("employees.urls_front_auth", namespace="auth_front")),
|
|
path("documents/", include("documents.urls", namespace="documents")),
|
|
path("requests/", include("requests_app.urls", namespace="requests")),
|
|
path("employees/", include("employees.urls_front", namespace="employees")),
|
|
path("communications/", include("communications.urls", namespace="communications")),
|
|
path("notifications/", include("notifications.urls", namespace="notifications")),
|
|
path("search/", include("search.urls", namespace="search")),
|
|
path("finance/", include("finance.urls", namespace="finance")),
|
|
path("api/", include(("api.urls", "api"), namespace="api")),
|
|
# Service Worker должен быть в корне для правильного scope
|
|
path("sw.js", serve, {"document_root": settings.BASE_DIR, "path": "sw.js", "content_type": "application/javascript"}, name="sw"),
|
|
path("", include("feed.urls_front", namespace="feed")),
|
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|