Convert all API endpoint URLs to SX expression format
Every URL at sx-web.org now uses bracketed SX expressions — pages AND API endpoints. defhandler :path values, sx-get/sx-post/sx-delete attrs, code examples, and Python route decorators all converted. - Add SxAtomConverter to handlers.py for parameter matching inside expression URLs (e.g. /(api.(item.<sx:item_id>))) - Convert ~50 defhandler :path values in ref-api.sx and examples.sx - Convert ~90 sx-get/sx-post/sx-delete URLs in reference.sx, examples.sx - Convert ~30 code example URLs in examples-content.sx - Convert ~30 API URLs in pages.py (Python string code examples) - Convert ~70 page navigation URLs in pages.py - Convert 7 Python route decorators in routes.py - Convert ~10 reactive API URLs in marshes.sx - Add API redirect patterns to sx_router.py (301 for old paths) - Remove /api/ skip in app.py redirects (old API paths now redirect) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -128,9 +128,6 @@ def create_app() -> "Quart":
|
||||
# Skip SX expression URLs (already in new format)
|
||||
if path.startswith("/(") or path.startswith("/~"):
|
||||
return None
|
||||
# Skip API/handler paths
|
||||
if "/api/" in path:
|
||||
return None
|
||||
new_url = redirect_old_url(path)
|
||||
if new_url:
|
||||
qs = request.query_string.decode()
|
||||
@@ -149,7 +146,6 @@ def create_app() -> "Quart":
|
||||
and not path.endswith("/")
|
||||
and request.method == "GET"
|
||||
and not path.startswith(("/static/", "/internal/", "/auth/"))
|
||||
and "/api/" not in path
|
||||
and "." not in path.rsplit("/", 1)[-1]):
|
||||
qs = request.query_string.decode()
|
||||
target = path + "/" + ("?" + qs if qs else "")
|
||||
|
||||
Reference in New Issue
Block a user