SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create an Application with Cloud Foundry Node.js Buildpack

Create a simple Node.js application and enable services for it, by using the Cloud Foundry Node.js buildpack and Cloud Foundry Command Line Interface (cf CLI).

Overview

🎓 beginner 45 min. Node JsBeginnerSAP BTP Cloud Foundry EnvironmentSAP BTP Cockpit

You will learn

  • โœ”How to create a simple “Hello World” application in Node.js
  • โœ”How to create an application router for it
  • โœ”How to run authentication and authorization checks via the Authorization and Trust Management (XSUAA) service
Gergana Coffman G Gergana Coffman June 4, 2026
Created by July 14, 2023
Contributors

Prerequisites

Prerequisites

Steps

Intro

This tutorial will guide you through creating and setting up a simple Node.js application in cf CLI. You will start by building and deploying a web application that returns simple data โ€“ a Hello World! message, and then invoking this app through a web microservice (application router). Finally, you will set authentication checks and authorization roles to properly access and manage your web application.


Step 1 Log on to SAP BTP
โ€”

First, you need to connect to the SAP BTP, Cloud Foundry environment with your trial or enterprise (productive) subaccount. Your Cloud Foundry URL depends on the region where the API endpoint belongs to. To find out which one is yours, see: [Regions and API Endpoints Available for the CF Environment] (https://help.sap.com/docs/btp/sap-business-technology-platform/regions-and-api-endpoints-available-for-cloud-foundry-environment)

In this tutorial, we use eu20 as an example.

  1. Open a command-line console.

  2. Set the Cloud Foundry API endpoint for your subaccount. Run the following command (using your actual region URL):

    Bash/Shell
    cf api https://api.cf.eu20.hana.ondemand.com
  3. Log on to the SAP BTP, Cloud Foundry environment:

    Bash/Shell
    cf login
  4. When prompted, enter your user credentials. These are the email and password you have used to register your trial or productive SAP BTP account.

    IMPORTANT: If the authentication fails, even though you’ve entered correct credentials, try [logging in via single sign-on] (https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/e1009b4aa486462a8951c4d499ce6d4c.html?version=Cloud).

  5. Choose the org name and space where you want to create your application.

    If you’re using a trial account, you don’t need to choose anything. You can use only one org name, and your default space is dev.

RESULT

Details about your personal SAP BTP subaccount are displayed (API endpoint, user, organization, space).

Step 2 Create a Node.js application
+
Step 3 Run an Authentication Check
+
Step 4 Run an Authorization Check
+
Step 5 Assigning Roles to a User in SAP BTP Cockpit
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Log on to SAP BTP 2. Create a Node.js application 3. Run an Authentication Check 4. Run an Authorization Check 5. Assigning Roles to a User in SAP BTP Cockpit

Learn more →