A manifest and icons make it installable. A service worker at /sw.js, so its scope is every page, keeps by kind of URL: content-addressed blobs and blocks for good, as projects load them; the versioned bundle and styles until the next build; and the last copy of the page, the API reads and other statics, for when there is no network. A project opened once opens again offline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FLuCjp9kNH6ovwJVXSbq9
23 lines
1 KiB
Python
23 lines
1 KiB
Python
from django.contrib import admin
|
|
from django.urls import include, path
|
|
|
|
from clips import views
|
|
|
|
urlpatterns = [
|
|
# `/index.html` as well as `/`, because that is the URL the browser suite has
|
|
# used since step 5 — shadow-cljs's dev server did no directory-index
|
|
# resolution, so the suite learned to ask for the file. Keeping both means
|
|
# ARTHUR_URL can stay pointed at the same place and only the port moves.
|
|
path("", views.page, name="page"),
|
|
path("index.html", views.page),
|
|
# A project's own address, with its name as a slug for people to read. The
|
|
# same page; the client reads the id out of the path and opens it.
|
|
path("p/<uuid:project_id>", views.page),
|
|
path("p/<uuid:project_id>/<slug:slug>", views.page),
|
|
# The service worker, at the root so it can control every page; see
|
|
# `views.service_worker`.
|
|
path("sw.js", views.service_worker),
|
|
path("api/", include("clips.urls")),
|
|
path("blob/<str:digest>", views.blob, name="blob"),
|
|
path("admin/", admin.site.urls),
|
|
]
|