CAP with Local App Previews – Tips for Smooth Development

Estimated read time 2 min read

UI5 has recently introduced Virtual Endpoints, eliminating the need for sandbox files and reducing maintenance effort in local previews. For details, please read the blog post below:

https://community.sap.com/t5/technology-blog-posts-by-sap/streamlining-local-app-previews-virtual-endpoints-for-seamless-development/ba-p/14155498

I have tried virtual endpoints with CAP Node.js, and would like to share a few things I noticed.

TypeScript as a prerequisite

By default, you will not see the “Use virtual endpoints for local preview” option. This option becomes available once you enable TypeScript.

Select the #app-preview endpoint for testing the app inside Fiori Launchpad

When you start the server with `cds watch`, you will see several options for opening the app. The #app-preview option is optimal choice for testing the app inside the Fiori Launchpad (sandbox).

Reinstall dependencies after build

After building the MTA, you will not see the virtual endpoints anymore. This is due to the `npm ci` command executed during the build (I haven’t dug deeper into the cause). To enable the virtual endpoints again, simply run `npm install`.

That’s it. I hope this post is useful.

 

​ UI5 has recently introduced Virtual Endpoints, eliminating the need for sandbox files and reducing maintenance effort in local previews. For details, please read the blog post below:https://community.sap.com/t5/technology-blog-posts-by-sap/streamlining-local-app-previews-virtual-endpoints-for-seamless-development/ba-p/14155498I have tried virtual endpoints with CAP Node.js, and would like to share a few things I noticed.TypeScript as a prerequisiteBy default, you will not see the “Use virtual endpoints for local preview” option. This option becomes available once you enable TypeScript.Select the #app-preview endpoint for testing the app inside Fiori LaunchpadWhen you start the server with `cds watch`, you will see several options for opening the app. The #app-preview option is optimal choice for testing the app inside the Fiori Launchpad (sandbox).Reinstall dependencies after buildAfter building the MTA, you will not see the virtual endpoints anymore. This is due to the `npm ci` command executed during the build (I haven’t dug deeper into the cause). To enable the virtual endpoints again, simply run `npm install`.That’s it. I hope this post is useful.   Read More Technology Blog Posts by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author