Sitevision Developer
Log in

Log in

appResource

The AppResource utility is used to access resources within a RESTApp. Add the resources to the resource folder located in the root of the project.

Methods

Resources can be accessed in three different ways, where pathToResource is the path to the file in the resource folder.

appResource.getContent(pathToResource)

Returns the resource as a UTF-8 based string.

appResource.getNode(pathToResource)

Returns the resource as a JCR Node (sv:image or sv:file).

Example

Resource folder example
Did you find the content on this page useful?