Complete reference for WSX server-side APIs
adapter
- A WSXServerAdapter implementation (Express, Hono, or custom)handler
(optional) - Handler name to match against wx-send
attributehandlerFunction
- Function to handle the requesttarget
- CSS selector for the target elementhtml
- HTML content to insertswap
(optional) - Swap method (default: ‘innerHTML’)connectionId
- ID of the target connectiontarget
- CSS selector for the target elementhtml
- HTML content to insertswap
(optional) - Swap method (default: ‘innerHTML’)connectionId
- ID of the connection to removeid
- Unique identifier for the requesthandler
- Handler name specified in wx-send
attributetarget
- CSS selector from wx-target
attributetrigger
- Event that triggered the requestdata
- Form data or data from wx-data
attributeswap
- Swap specification from wx-swap
attributeid
- Must match the request IDtarget
- CSS selector for the element to updatehtml
- HTML content to insertswap
- How to insert the content (innerHTML, outerHTML, etc.)oob
- Array of out-of-band updates for other elementstarget
- CSS selector for the element to updatehtml
- HTML content to insertswap
- How to insert the contentid
- Unique identifier for the connectionsessionData
- Object for storing session-specific datasend()
- Method to send data to the clientclose()
- Method to close the connectionrequest
- The incoming requestconnection
- The connection that sent the requestWSXResponse
- Single responseWSXResponse[]
- Array of responsesvoid
- No response (useful for side effects only)setupWebSocket()
- Set up WebSocket handlingonConnection()
- Optional connection handleronDisconnection()
- Optional disconnection handlergetApp()
- Return the framework app instance