compileAliasTarget
Function: compileAliasTarget()
compileAliasTarget(
alias,target):object
Defined in: packages/core/src/rest/router.service.ts:76
Compile an alias target into a fast resolver
Supported placeholders:
${user.id}:ctx.getCurrentUserId(), throws Unauthorized (401) if undefined${params.<name>}: parameter from alias template ({name},{+name},{?name}), empty string if undefined${params.<name>*}: catch-all query object serialized askey=value&..., empty string if undefined
Parameters
alias
string
the alias URL template
target
string
the target URL pattern
Returns
object
compiled resolver with requiresUser flag and resolve function
requiresUser
requiresUser:
boolean
resolve
resolve: (
ctx,params) =>string
Parameters
ctx
params
Record<string, any>
Returns
string