GatewayResource
Source:
src/AWS/ApiGateway/GatewayResource.ts
A path segment under a REST API resource tree.
Resources form the URL hierarchy of a REST API: every path segment
(/items, /items/{id}, /{proxy+}) is a Resource whose parentId
points either at api.rootResourceId (for top-level paths) or at
another Resource’s resourceId (for nested paths). Attach methods
to a resource by passing its resourceId to ApiGateway.Method.
Path resources
Section titled “Path resources”Top-level path
const items = yield* ApiGateway.Resource("Items", { restApi: api, parentId: api.rootResourceId, pathPart: "items",});Nested path with a greedy proxy
const items = yield* ApiGateway.Resource("Items", { restApi: api, parentId: api.rootResourceId, pathPart: "items",});
const anyItem = yield* ApiGateway.Resource("AnyItem", { restApi: api, parentId: items.resourceId, pathPart: "{proxy+}",});