4.6.2.1. Including in a Project

REST API is implemented in the portal module of the cuba base project, therefore you need to create portal module in your application project. The easiest way to do this is to run the Create portal module command on the Project properties panel of the CUBA Studio navigator.

Key configuration elements:

  • Add REST API controllers to Spring context defined by the portal-dispatcher-spring.xml file:

    <context:component-scan base-package="com.haulmont.cuba.portal.restapi"/>

  • Set access mode in portal-security-spring.xml:

    <intercept-url pattern="/api/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>