LIVE VIEW + SERVER
Transform one request
The View owns editable input. The server owns normalization and computation, then returns serializable data for rendering.
Values used for sort, sum, average, first, and count: [3 10 5]
SERVER BLOCK / UTILITIES
Portable server utilities
One endpoint demonstrates string normalization, parsing, sorting, math, list operations, URL encoding, JSON merging, and timestamps without JavaScript or Node.js.
LIVE VIEW + SERVER
Transform one request
The View owns editable input. The server owns normalization and computation, then returns serializable data for rendering.
Values used for sort, sum, average, first, and count: [3 10 5]
NORMALIZED OUTPUT
Slug
COMPUTED OUTPUT
The response also includes total, average, count, first, encoded, summary, and timestamp.
Total
Average
Count
SOURCE FILES
Capability-first, target-neutral code
Each declaration names its namespace, result binding, source function, and inputs. The same server model executes in the Rust runtime.
signal result value:{ normalized:"" slug:"" total:"" average:"" count:"" }
fn runUtilities
request response method:"POST" route:"/api/examples/utilities" body:utilityForm
if response.ok
set result value:response.data
Text
"{result.normalized}"handler runExampleUtilities
const body value:req.json
str normalized source:"trim" value:body.text
str slug source:"lower" value:normalized
str slugged source:"replace" value:slug from:" " to:"-"
parse number source:"int" value:body.number fallback:0
sort ordered source:"desc" values:body.values
math total source:"sum" values:ordered
math average source:"average" values:ordered
list count source:"count" values:ordered
list first source:"first" values:ordered
url encoded source:"encode" value:slugged
json summary source:"merge" left:{ slug:slugged } right:{ count:count }
date timestamp source:"now"
return json:{ ok:true data:{ normalized:normalized slug:slugged number:number ordered:ordered total:total average:average count:count first:first encoded:encoded summary:summary timestamp:timestamp } }str: trim, lower, upper, length, contains, startsWith, endsWith, replace, split, join
math: add, sub, mul, div, round, floor, ceil, abs, min, max, sum, average
parse: int, float, bool, json, string, svg
url: encode, decode, parse, queryGet, querySet
sort: asc, desc, by
list: take, skip, first, last, count, filterEquals, filterContains, mapField
json: get, set, pick, omit, merge, stringify, parse
date: now, formatIso, addDays, diffDays