Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.27 KB

File metadata and controls

58 lines (42 loc) · 1.27 KB

on

Conditional or event handler.

Kind Attribute
Since 0.1.0
Repeatable yes

Syntax

on <condition-or-event>

Description

Inside a body, branches on the result of the previous step: on success, on error, on not found, on forbidden. Inside a socket or webhook, dispatches on connection events (on connect, on message, on disconnect) or named webhook events (on event <name>).

Used in

Examples

Branch on action outcome

action /users/create method POST
  validate user
  query: INSERT INTO user (...) VALUES (...)
  on success
    redirect /users
  on error
    respond fragment ".form" query: SELECT * FROM user WHERE id = :id

See also

Provenance

Spec last touched 18cf488 (2026-05-20)
Source last touched af278bb (2026-05-20)
Source files internal/parser/parser.go