AMI Web Framework API > Namespace > amiRouter


amiRouter

The AMI url routing subsystem

Methods


getWebAppURL() ->{string}
Gets the webapp URL

Returns:
The webapp URL
Type: string

getWebAppArgs() ->{Object.<string, string>}
Gets the arguments of the webapp URL

Returns:
The arguments of the webapp URL
Type: Object.<string, string>

getWebAppHash() ->{string}
Gets the anchor part of the webapp URL

Returns:
The anchor part of the webapp URL
Type: string

getScriptURL() ->{string}
Gets the script URL

Returns:
The script URL
Type: string

getScriptArgs() ->{Object.<string, string>}
Gets the arguments of the script URL

Returns:
The arguments of the the script URL
Type: Object.<string, string>

getWebappHash() ->{string}
Gets anchor part of the script URL

Returns:
The anchor part of the script URL
Type: string

getOriginURL() ->{string}
Gets the origin URL

Returns:
The origin URL
Type: string

append(regExp, callback) ->{AMIRouter}
Appends a routing rule

Parameters:
NameTypeDescriptionDefaultOptionalNullable
regExpstringthe regExp
callbackfunctionthe callback
Returns:
The amiRouter singleton
Type: AMIRouter

remove(regExp) ->{AMIRouter}
Removes a routing rule

Parameters:
NameTypeDescriptionDefaultOptionalNullable
regExpstringthe regExp
Returns:
The amiRouter singleton
Type: AMIRouter

check() ->{boolean}
Checks whether the URL matches with a routing rule

Returns:
Type: boolean

appendHistoryEntry(path, context) ->{boolean}
Appends a new history entry

Parameters:
NameTypeDescriptionDefaultOptionalNullable
pathstringthe new path
contextObject.<string, *>the new context
Returns:
Type: boolean

replaceHistoryEntry(path, context) ->{boolean}
Replaces the current history entry

Parameters:
NameTypeDescriptionDefaultOptionalNullable
pathstringthe new path
contextObject.<string, *>the new context
Returns:
Type: boolean