http/rs/resource-mappings
Documentation
- source: http/rs/resource-mappings.ts
Overview
Classes
ResourceMappings
path()
Creates or retrieves a Resource object corresponding to the given path. The second, optional argument can be used to initialize the resource.
tspath(sPath: string, oConfiguration: any): Resource;
Parameter Type Description sPathstringThe URL path template for the resource (e.g., "users/{id}"). oConfigurationanyOptional configuration object for initial resource setup. Returns
- Type:
Resource- Description: The created or existing Resource instance.
resourcePath()
Alias for path().
tsresourcePath(sPath: string, oConfiguration: any): Resource;
Parameter Type Description sPathstringoConfigurationanyReturns
- Type:
Resource- Description:
resource()
Alias for path().
tsresource(sPath: string, oConfiguration: any): Resource;
Parameter Type Description sPathstringoConfigurationanyReturns
- Type:
Resource- Description:
configuration()
Returns the compiled configuration object for all resources managed by this ResourceMappings. The configuration is structured to be consumed by the HttpController's routing logic.
tsconfiguration(): void;Returns
- Type:
void- Description:
readonly()
Removes all but GET resource handlers from all managed resources, making them read-only.
tsreadonly(): this;Returns
- Type:
this- Description: The ResourceMappings instance for method chaining.
disable()
Disables resource handling specifications matching the arguments, effectively removing them from this API.
tsdisable(sPath: string, sVerb: string, arrConsumes: any, arrProduces: any): this;
Parameter Type Description sPathstringThe path of the resource. sVerbstringThe HTTP verb (e.g., 'get', 'post'). arrConsumesanyArray of consumed media types. arrProducesanyArray of produced media types. Returns
- Type:
this- Description: The ResourceMappings instance for method chaining.
find()
Provides a reference to a handler specification matching the supplied arguments.
tsfind(sPath: string, sVerb: string, arrConsumes: any, arrProduces: any): any;
Parameter Type Description sPathstringThe path of the resource. sVerbstringThe HTTP verb (e.g., 'get', 'post'). arrConsumesanyArray of consumed media types. arrProducesanyArray of produced media types. Returns
- Type:
any- Description: The matching Resource handler specification or undefined.
