Module: Parser

Methods


<static> getRouteLine(url, modelName, actionName, actionData)

Create routeLine for end-point
Parameters:
Name Type Description
url string url in manifest format
modelName string name of the model
actionName string name of the action in the route file
actionData object data from manifest for this action
Returns:
resolved router line
Type
string

<static> parseLine(line, modelName, actionName)

routeLine parser
Parameters:
Name Type Description
line string raw route line like '/api/:modelName' or '/:record[_id]'
modelName string is for name of the model routes collection
actionName string is for name of the action in the routes collection record[fieldName] - is for client side mostly, shows what model field walue should be placed there. Samples ':record[_id]', ':record[authorId]'
Returns:
resolved line
Type
string