Extend defhandler with :path/:method/:csrf, migrate 12 ref endpoints to SX
defhandler now supports keyword options for public route registration: (defhandler name :path "/..." :method :post :csrf false (&key) body) Infrastructure: forms.sx parses options, HandlerDef stores path/method/csrf, register_route_handlers() mounts path-based handlers as app routes. New IO primitives (boundary.sx "Web interop" section): now, sleep, request-form, request-json, request-header, request-content-type. First migration: 12 reference API endpoints from Python f-string SX to declarative .sx handlers in sx/sx/handlers/ref-api.sx. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,6 +103,14 @@ def create_app() -> "Quart":
|
||||
bp = register_pages(url_prefix="/")
|
||||
app.register_blueprint(bp)
|
||||
|
||||
# Register SX-defined route handlers (defhandler with :path)
|
||||
from shared.sx.handlers import register_route_handlers
|
||||
n_routes = register_route_handlers(app, "sx")
|
||||
if n_routes:
|
||||
import logging
|
||||
logging.getLogger("sx.handlers").info(
|
||||
"Registered %d route handler(s) for sx", n_routes)
|
||||
|
||||
from shared.sx.pages import auto_mount_pages
|
||||
auto_mount_pages(app, "sx")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user