You are here. See how this question connects to other ideas.
Select a node to open its page · Expand to read within the map
One question
How do you start a read-only provider?
Begin with one explicit resource and its path contract before adding operations.
Specify observable behavior first
Our teaching target is a report resource with a title and status. It sends no messages, writes no disk files and connects no external account. Specify the requested path, returned content and missing-resource behavior before choosing implementation details.
AFSBaseProvider supplies routing and shared behavior. @Read declares a read handler; @List declares a listing handler. A handler returns an entry, and the AFS dispatcher places its relative path back in the caller’s namespace. Inheriting the base class does not implement every operation.
// Handler fragment: not a complete provider or conformance fixture.
@Read("/report")
async readReport(ctx: RouteContext) {
return {
id: "report",
path: ctx.path,
content: { title: "Prepare the keynote", status: "draft" }
};
}Why begin read-only?
This version isolates naming, content and explanations. Adding writes requires validation, persistence, authority and conflict decisions. A button changing local state does not establish those behaviors.
Continue with the provider authoring guide and prepare conformance fixtures for the capabilities actually implemented.
Check your understanding
How do you start a read-only provider?
Begin with one explicit resource and its path contract before adding operations.
Continue along a learning path
- Build and check a providerStep 2 of 6