Creating Custom Rest API controller


How do I create a custom REST API controller in Cuba Studio?
Where do I place the controller class?
This controller has no relation to any Generic UI Screen just a simple Rest Controller.

How does this controller get generated by the Front-end Generator in the Typescript SDK?
I can’t seem to find the steps in any of the guides.

Thank you.

Kind Regards,


I hope this example will answer your questions. It exposes a service using custom REST API controller and Generic REST features.

Classes of interest:

We’d recommend using portal module for the custom REST, but you can place it to the web module as well using standard Spring’s annotations.

Also, have a look at the documentation on securing custom REST controllers.


I was uunder the impresetion that for Portal is using MVC dan requires a view.
The controller that I mean does not require a view.

Is portal still suitable even though I don’t have a view?

What kind of security do I need to take into consideration if there are no views?


Kind Regards,

1 Like

Please have a look at the example that I provided. You don’t need a view to publish a custom REST API in the portal module.

If you don’t specify any additional security, all endpoints in the portal module will be protected using BASIC authorization, so you can use your username/password specified in CUBA application.

Thanks for the info.
Let me study the example first.

Kind Regards,