resourcekeyword. As shown in the example below, we are declaring the
/messagespath as a resource path. As part of the declaration, we specify what controller the resource path should use to create its complete routes.
denykeyword to permit or prohibit actions on the resource, respectively. If you use the
allowkeyword, then all resource actions are prohibited except the ones listed. Likewise, if you use the
denykeyword, then all resource actions are permitted except for the ones listed.
Controllerclass, you extend the
ResourceControllerclass has a methods that correspond to each action listed in the table above. You just have to provide the corresponding implementation for each supported action.
ResourceControllerclass has empty methods for each action by design. This is because the implementation of a resource controller depends heavily on where the data is persisted. For example, a in-memory resource controller will store its resources in memory. Whereas, a MongoDB resource controller will persists is resources to a MongoDB database. We therefore recommend that you leverage a domain-specific resource controller since it will provide a default implementation for each action while giving you the ability to customize it accordingly.