What is SAP Approuter and its importance ?

Estimated read time 7 min read

Introduction

SAP Approuter is a lightweight service, which acts as a single point of entry for various back-end services and applications in SAP ecosystem. In many SAP cloud foundry enterprise applications, Approuter plays an essential role in tying together different pieces of the application landscape and ensuring smooth user experience. In this blog, I am going to share my learning on Approuter and its usage.

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 micro services while propagating user information.

Which environments Approuter can be used in

SAP Cloud Foundry, SAP BTPSAP 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 setup and run by application owner, it allows customization/extension as per application need.  Managed Approuter :Managed Approuter is provided by SAP, so application owner need not to maintain own runtime infrastructure.The Managed Approuter is the HTML5 applications runtime capability that is provided by the following products. To use the managed application router, we must be subscribed to one of these services.SAP Build Work Zone, standard editionSAP Build Work Zone, advanced editionSAP Cloud PortalSAP recommends to use 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 authorization 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: Approuter supports scenarios where services need to communicate with each other without the need for user intervention.Serve Static Content: It can also be configured to serve static content, such as HTML, CSS, and JavaScript files.Integration with XSUAA: SAP’s User Account and Authentication (XSUAA) service is commonly used for authentication and authorization in the SAP Cloud Platform, and Approuter is well-integrated with it.Extension and Customization: The Approuter is built on Node.js, which means that developers can extend its capabilities or integrate it with other Node.js modules if needed.

Approuter project structure and it’s components.

<myApproute>

  |- xs-app.json               # Application routes configuration

  |- package.json              # Application router details/dependencies

 

 

 

Architecture diagram of an application

Suppose we have a requirement to develop a Project Management solution for one of the organizations having SAP BTP. The solution needs to integrate with SAP SuccessFactors for employee’s HR related information and needs to integrate 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 SuccessFactors system. The APIs will be available publicly as this is hosted in SAP BTP, so it is very important to securely expose the APIs by using SAP BTP’s authentication and authorization service, which can be easily done by using SAP Approuter. Here is the architecture of the application.

 

Thanks,

Sudhir.

 

​ IntroductionSAP Approuter is a lightweight service, which acts as a single point of entry for various back-end services and applications in SAP ecosystem. In many SAP cloud foundry enterprise applications, Approuter plays an essential role in tying together different pieces of the application landscape and ensuring smooth user experience. In this blog, I am going to share my learning on Approuter and its usage.What is SAP ApprouterSAP 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 micro services while propagating user information.Which environments Approuter can be used inSAP Cloud Foundry, SAP BTPSAP XSA – XS Advanced (On Premise)Types of Approuter available in SAP BTPThere 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 setup and run by application owner, it allows customization/extension as per application need.  Managed Approuter :Managed Approuter is provided by SAP, so application owner need not to maintain own runtime infrastructure.The Managed Approuter is the HTML5 applications runtime capability that is provided by the following products. To use the managed application router, we must be subscribed to one of these services.SAP Build Work Zone, standard editionSAP Build Work Zone, advanced editionSAP Cloud PortalSAP recommends to use Managed Approuter if there is no extension required.Primary features and functionalities of SAP ApprouterRequest 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 authorization 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: Approuter supports scenarios where services need to communicate with each other without the need for user intervention.Serve Static Content: It can also be configured to serve static content, such as HTML, CSS, and JavaScript files.Integration with XSUAA: SAP’s User Account and Authentication (XSUAA) service is commonly used for authentication and authorization in the SAP Cloud Platform, and Approuter is well-integrated with it.Extension and Customization: The Approuter is built on Node.js, which means that developers can extend its capabilities or integrate it with other Node.js modules if needed.Approuter project structure and it’s components.<myApproute>  |- xs-app.json               # Application routes configuration  |- package.json              # Application router details/dependencies   Architecture diagram of an applicationSuppose we have a requirement to develop a Project Management solution for one of the organizations having SAP BTP. The solution needs to integrate with SAP SuccessFactors for employee’s HR related information and needs to integrate 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 SuccessFactors system. The APIs will be available publicly as this is hosted in SAP BTP, so it is very important to securely expose the APIs by using SAP BTP’s authentication and authorization service, which can be easily done by using SAP Approuter. Here is the architecture of the application. Thanks,Sudhir.   Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author

+ There are no comments

Add yours