Prefix all SX URLs with /sx/ for WhatsApp-safe sharing

All routes moved under /sx/ prefix:
- / redirects to /sx/
- /sx/ serves home page
- /sx/<path:expr> is the catch-all for SX expression URLs
- Bare /(...) and /~... redirect to /sx/(...) and /sx/~...
- All ~600 hrefs, sx-get attrs, defhandler paths, redirect
  targets, and blueprint routes updated across 44 files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 19:07:09 +00:00
parent acd2fa6541
commit de80d921e9
44 changed files with 701 additions and 687 deletions

View File

@@ -23,7 +23,7 @@ def register(url_prefix: str = "/") -> Blueprint:
# SSE stays in Python — fundamentally different paradigm (async generator).
# ------------------------------------------------------------------
@bp.get("/(geography.(hypermedia.(reference.(api.sse-time))))")
@bp.get("/sx/(geography.(hypermedia.(reference.(api.sse-time))))")
async def ref_sse_time():
async def generate():
for _ in range(30): # stream for 60 seconds max
@@ -38,7 +38,7 @@ def register(url_prefix: str = "/") -> Blueprint:
_marsh_sale_idx = {"n": 0}
@bp.get("/(geography.(reactive.(api.flash-sale)))")
@bp.get("/sx/(geography.(reactive.(api.flash-sale)))")
async def api_marsh_flash_sale():
from shared.sx.helpers import sx_response
prices = [14.99, 9.99, 24.99, 12.49, 7.99, 29.99, 4.99, 16.50]
@@ -60,7 +60,7 @@ def register(url_prefix: str = "/") -> Blueprint:
_settle_counter = {"n": 0}
@bp.get("/(geography.(reactive.(api.settle-data)))")
@bp.get("/sx/(geography.(reactive.(api.settle-data)))")
async def api_settle_data():
from shared.sx.helpers import sx_response
_settle_counter["n"] += 1
@@ -76,7 +76,7 @@ def register(url_prefix: str = "/") -> Blueprint:
# --- Demo 4: signal-bound URL endpoints ---
@bp.get("/(geography.(reactive.(api.search-products)))")
@bp.get("/sx/(geography.(reactive.(api.search-products)))")
async def api_search_products():
from shared.sx.helpers import sx_response
q = request.args.get("q", "")
@@ -95,7 +95,7 @@ def register(url_prefix: str = "/") -> Blueprint:
)
return sx_response(sx_src)
@bp.get("/(geography.(reactive.(api.search-events)))")
@bp.get("/sx/(geography.(reactive.(api.search-events)))")
async def api_search_events():
from shared.sx.helpers import sx_response
q = request.args.get("q", "")
@@ -114,7 +114,7 @@ def register(url_prefix: str = "/") -> Blueprint:
)
return sx_response(sx_src)
@bp.get("/(geography.(reactive.(api.search-posts)))")
@bp.get("/sx/(geography.(reactive.(api.search-posts)))")
async def api_search_posts():
from shared.sx.helpers import sx_response
q = request.args.get("q", "")
@@ -135,7 +135,7 @@ def register(url_prefix: str = "/") -> Blueprint:
# --- Demo 5: marsh transform endpoint ---
@bp.get("/(geography.(reactive.(api.catalog)))")
@bp.get("/sx/(geography.(reactive.(api.catalog)))")
async def api_catalog():
from shared.sx.helpers import sx_response
items = [