REST configuration and Portal

Hello,

In order to use REST Services is mandatory to create a portal (http://localhost:8082/my-portal)?

Best Regards,
-n

Hi,

No, it is not. REST API is available from the web module. An example : CUBA REST API

Hi,

So what is the main goal of the portal: to access the same application from the mobile phone?

Best Regards,
-n

Take a look at this section in the documentation.

Yes, but apart to use REST API as add on CUBA REST API is possible to use REST API from the portal module Portal Components - CUBA Platform. Developer’s Manual.
Basically this is my question: what are the differences between these two approaches?

Portal module also uses the REST API addon. Portal doesn’t contain any alternative REST API implementation.

1 Like

It’s strange because I can use portal module REST API without any add-on.
modules/portal/src/com/mycomp/myapp/portal/controllers/RestController.java

@org.springframework.web.bind.annotation.RestController
public class RestController {

    @GetMapping (value = "/myaction", produces = "text/plain;charset=utf8")
    @ResponseBody
    public String activateMyAction(@RequestParam(defaultValue = "") String myId,
                       @RequestParam(defaultValue = "") String email,
                      
                       final HttpServletRequest argRequest
                       ){
        return legacyRestWebService.doActivation(myId, emailAddress);
    }