Optional params with .try()
Use double brackets for optional segments and read them safely with .try()
(or a schema default).
.get(key)
throws when the parameter is absent; prefer .try(key)
for optional segments.touch routes/user/[[name]].ts
// routes/user/[[name]].ts
import route from "primate/route";
route.get(request => {
const name = request.path.try("name") ?? "guest";
return `Hello, ${name}!`;
});