I need to integrate a Cuba REST API with an Angular Application.
I have created a REST API using cuba in web module. To integrate it with an Angular JS application what is recommended ? Create a Portal module like described here: [url=]https://github.com/cuba-platform/sample-portal[/url] or should I put the Angular application inside the web module directly ?
The generation of the OAuth token and its putting on http request headers are done automatically by Cuba or do I have do set something in the Angular application ?
Hi,
It’s not required to place your Angular application along with CUBA application. Portal Module is just an option.
All client applications should obtain an OAuth token by themselves and then use it for all future RESP API requests. A token can be obtained by the POST request on the address:
The detailed documentation for the API is written according to Swagger specification and is available at the following URL: [url=http://files.cuba-platform.com/swagger]http://files.cuba-platform.com/swagger[/url].
You can find REST API usage examples in the documentation.
Alternatively, you can access REST API without an OAuth token using Anonymous Access.
To simplify developers’ life we have JavaScript library for web and Node.js which facilitates CUBA Platform’s REST API usage. Check its GitHub page.
Also, we’re going to provide a webinar in which we will show how to develop a single-page web application with REST API backend using Angular 4.
You can overview upcoming webinars here.
Regards,
Gleb