RestInitApplication()
Registers the directory path under the service mapping virtual directory.
If no service mapping is provided, the application name is used.
If the rest application is already registered, it is refreshed.
RestInitApplication( dirPath=string, serviceMapping=string, default=boolean, password=string );
Returns: void
| Argument | Description |
|---|---|
|
dirPath
string,
required
|
edit
Path to the directory to be registered or reset. This folder should contain
Alias: dir, directory, path |
|
serviceMapping
string,
optional
|
edit
Alternate string to be used for application name while calling the REST service. Alias: mapping |
|
default
boolean,
optional
|
edit
set if the mapping is a default mapping or not |
|
password
string,
optional
|
edit
password for the web administrator, this is needed when you update/create a REST mapping. Alias: webAdminPassword |
Examples
editrestInitApplication( dirPath="path_to_cfc_dir", serviceMapping="api", password="webAdminPassword" );
Simple REST enabled CFC example
component restpath="/restExample" rest="true" {
remote function getApplicationName() restpath="getApplicationName" httpmethod="GET,HEAD" {
return "applicationName:" & getApplicationSettings().name;
}
}