How to implement custom handlers - Cloud Applicati...
Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
In this session, we will look at how we can implement custom handlers in Cloud Application Programming Model
Synopsis:
CAP model provides generic handlers that takes care of all the CRUD functionality right out-of-the-box
Sometimes, this may be enough for your business needs, but other times you may need to do more based on business requirements
We can add custom middleware functions that can run before, after or even instead of the generic handler
Steps:
In this example, we will start with a basic custom handler that logs all requests that are sent to the OData Service
Then we will add another custom handler that runs only for the Users entity - We will add a business requirement that all passwords need to be stored encrypted
We will make use of bcryptjs npm package to encrypt the password and store it in our SAP HANA database