Skip to main content

Shape

Fields

ResourceContents

  • { type: "text", text, mimeType? }
  • { type: "blob", blob, mimeType? }

Template URIs

If the resource URI contains {name} placeholders, Redop matches the concrete URI and passes the extracted values in params. When you register the resource with a literal template URI, Redop also infers the params type from those placeholders. This means app.resource("users://{id}/profile", ...) gives you params.id: string in the handler, hooks, and resource middleware. Static resources do not get template params, so params is undefined there. Redop also validates resource registration inputs early:
  • the resource URI must be non-empty, trimmed, and free of whitespace
  • the resource URI must include a valid scheme such as file:, app:, or users:
  • URI templates must have balanced {} expressions
  • duplicate resource URIs are rejected
  • the resource name must be non-empty and trimmed

Notes

  • Use afterResponse for non-critical post-response work such as logging, metrics, or audit events.
  • Use after instead when the logic must still be able to replace the successful resource result.