Skip to Content
Technical Articles
Author's profile photo Milton Chandradas

How to connect Node.js application to public and On-Premise system – Cloud Foundry environment

Github repository:

To be published soon…

 

Introduction:

  • In this session, we will look at how to connect Node.js application to public and On-Premise systems in SAP Cloud Platform – Cloud Foundry environment

 

Synopsis:

  • In the previous sessions, we had looked at how to connect SAPUI5 applications to public and On-Premise systems
  • The key differentiator between SAPUI5 application and Node.js application is that the Node.js application runs on the backend whereas the SAPUI5 application runs on the browser
  • We will make use of axios – a popular npm package for making HTTP requests
  • The Connectivity Service and Destination Service together can be used to connect to On-Premise systems
  • The Connectivity Service acts as a standard HTTP proxy to connect and retrieve data from the On-Premise system

 

Steps:

  • In this example, we will create a simple Node.js application and consume the publicly available Northwind OData Service
  • Then we will modify the Node.js application to consume the publicly available Northwind OData Service – but this time reading key information from the Destination Service
  • We will then consume the On-Premise OData Service using both the Destination Service and the Connectivity Service

 

YouTube link:

 

Conclusion:

  • This video should give you a clear idea on how to use the Destination Service and Connectivity Service together in a Node.js application to connect to both publicly available endpoints and On-Premise systems
  • If you have questions or comments, please list them below and I will be happy to answer

 

Previous post:

https://blogs.sap.com/2020/09/19/how-to-connect-applications-to-on-premise-system-cloud-foundry-environment/

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Shobhit Pathak
      Shobhit Pathak

      Very informative blog.

      Author's profile photo Farhan Ahmed
      Farhan Ahmed

      Hello Milton,

      Could you please help me on below error?

      I have followed the exact steps given in your videos including the other video for destination.

      error -

      502 Bad Gateway: Registered endpoint failed to handle the request.
      Author's profile photo Milton Chandradas
      Milton Chandradas
      Blog Post Author

      Couple of questions...

      • Are you connecting to On-Premise or Cloud backend system ?
      • Do you know if your request is reaching the backend system ?
      • If your request is reaching the backend system and the backend system is failing - then you have to debug the backend system
      • If your request is not reaching the backend system at all, then something is wrong with your destination / connectivity set up or in the code - In this case, I will need more info to figure out what is wrong...
      Author's profile photo Farhan Ahmed
      Farhan Ahmed

      Hello Milton,

       

      Thanks for your reply.

      My issue has been resolved. There was an issue with the destination.

      It is resolved by creating below instance and bind it to my app:

      Destination Service

      Connectivity Service

      Authorization and Trust Management Service