Hi there…would like to know how can i use this in angular full steps…trying to connect to CUBA Rest API from angular… i have run the command below from this link CUBA Platform: TypeScript SDK and REST API – Jmix
my queston is there any link of tutoria on how to set up angular connect to CUBA Rest API using this typescriptSDK (the link i share) . a simple full project and running will do
You’ll need @cuba-platform/rest library to work with REST API. Check this page for documentation on both the library and REST API itself. This will allow you to authenticate, create and modify entities, etc., see documentation for more details on available endpoints.
TypeScript SDK is the TypeScript representation of your CUBA application’s entities, services, etc. Here is a short introduction. We plan to improve the documentation to describe in more details how to use the SDK, particularly when using a framework other that React. In a nutshell, it allows you to use your CUBA types at frontend side (see entities and enums folders in generated SDK), execute predefined queries by importing restQueries object from queries.ts and invoke service methods by importing restServices object from services.ts.
gen-cuba-front sdk:all then copy generated folder to somewhere in your project, e.g. shared folder, then you can use CubaApp to talk with your backend as described here.
Thanks @v.pushkin and @hanbing.yin for the support… i have checked the linked documentation the instructions and understand the usage of this gen-cuba-front sdk:all
and once i run the angular app i got this error
my CUBA App has already set this cuba.rest.allowedOrigins = “*” in web-app.properties
what could be wrong then ? which and where in need to allowed this CORS policy enabled…
Hi, all CORS requests to the REST API are allowed by default, you don’t have to set this app property. Could you remove the setting of cuba.rest.allowedOrigins and try again?