SAP Approuter is a lightweight service that acts as a single point of entry for various back-end services and applications in the SAP ecosystem.
In many SAP cloud foundry enterprise applications, Approuter is essential in tying together different pieces of the application landscape and ensuring a smooth user experience.
What is SAP Approuter?
SAP Approuter is a Node.js library used as a single point of entry to an enterprise application. The Approuter is used to serve static content, authenticate users, rewrite URLs, and forward or proxy requests to other microservices while propagating user information.
Which environments can Approuter be used in?
- SAP Cloud Foundry, SAP BTP
- SAP XSA – XS Advanced (On-Premise)
Types of Approuter available in SAP BTP
There are two types of Approuter available in SAP BTP, which can be used for the applications deployed in SAP Cloud Foundry.
- Standalone Approuter :
- Standalone Approuter needs to be set up and run by the application owner; it allows customisation/extension as per application need.
- Managed Approuter :
- SAP provides a managed Approuter, so the application owner does not have to maintain its runtime infrastructure.
- The Managed Approuter is the HTML5 applications runtime capability provided by the following products. One must be subscribed to one of these to use the managed application router:
- SAP Build Work Zone, standard edition
- SAP Build Work Zone, advanced edition
- SAP Cloud Portal
- SAP recommends using the Managed Approuter if there is no extension required.
Primary features and functionalities of SAP Approuter:
- Request Routing: The Approuter can route incoming requests to different microservices or applications based on the URL pattern.
- Authentication and Authorization: The Approuter is tightly integrated with the SAP Cloud Platform’s authentication and authorisation mechanisms. It can facilitate user authentication via various methods like SAML, and then manage user sessions.
- Destination Resolution: In the SAP Cloud environment, a “destination” is a predefined set of configurations that point to a specific backend system or service. The Approuter can resolve these destinations and direct the requests appropriately.
- Service-to-Service Calls: SAP Approuter supports scenarios where services need to communicate with each other without the need for user intervention.
- Integration with XSUAA: SAP’s User Account and Authentication (XSUAA) service is commonly used for authentication and authorisation in the SAP Cloud Platform, and Approuter is well-integrated.
- Extension and Customization: The Approuter is built on Node.js, so developers can extend its capabilities or integrate it with other Node.js modules if needed.
SAP Approuter project structure and its components.
|- xs-app.json # Application routes configuration
|- package.json # Application router details/dependencies
Architecture diagram of an application
Suppose we are required to develop a Project Management solution for one of the organisations with SAP BTP. The solution must integrate with SAP SuccessFactors for employees’ HR-related information and with SAP On-premises system for other information. In this case, we can develop an SAP UI5-based application for user interface and APIs in Java Spring boot/node JS to save or read data on HANA Cloud DB and to interact with APIs/OData services from SAP and the SuccessFactors system. The APIs will be publicly available as this is hosted in SAP BTP, so it is essential to securely expose them using SAP BTP’s authentication and authorisation service, which can be easily done using SAP Approuter.
See the architecture of the application below.
At On Device Solutions, you will find expert SAP architects and solution consultants with years of consulting and implementation experience in the SAP cloud and BTP space. Please get in touch now to discover how we can help you accomplish your enterprise mobility goals.