// Hello World — the reference example seeded into the default app on
// fresh installs. Bound to GET /hello.

let who = ctx.request.body;
let name = if who != () && type_of(who) == "map" && who.contains("name") {
    who.name
} else {
    "world"
};

return #{
    statusCode: 200,
    headers: #{ "Content-Type": "application/json" },
    body: #{ message: `Hello, ${name}!` }
};
