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 a CAP Business Service with Node.js Using Visual Studio Code

Develop a sample business service using Core Data & Services (CDS), Node.js, and SQLite, by using the SAP Cloud Application Programming Model (CAP) and developing on your local environment.

Overview

🎓 beginner 50 min. SAP Cloud Application Programming ModelBeginnerNode JsSAP Business Technology Platform

You will learn

  • How to develop a sample business service using CAP and Node.js
  • How to define a simple data model and a service that exposes the entities you created in your data model
  • How to run your service locally
  • How to deploy the data model to an SQLite database
  • How to add custom handlers to serve requests that aren’t handled automatically
René Jeglinsky R René Jeglinsky February 7, 2026
Created by December 10, 2024
Contributors

Prerequisites

Prerequisites

  • You’ve installed Node.js. Make sure you run the latest long-term support (LTS) version of Node.js with an even number like 20. Refrain from using odd versions, for which some modules with native parts will have no support and thus might even fail to install. In case of problems, see the Troubleshooting guide for CAP.
  • You’ve installed the latest version of Visual Studio Code (VS Code).
  • (Windows only) You’ve installed the SQLite tools for Windows. Find the steps how to install it in the How Do I Install SQLite section of the CAP documentation.
  • You’ve installed an HTTP client, for example, REST client.
  • If you don’t have a Cloud Foundry Trial subaccount and dev space on SAP BTP yet, create your Cloud Foundry Trial Account with US East (VA) as region and, if necessary Manage Entitlements. You need this to continue after this tutorial.

Steps

Windows macOS Linux BAS

Intro

Before you start, make sure that you’ve completed the prerequisites.

Step 1 Set up local development environment

  1. Open a command line window and install the cds development kit globally by executing the following command:

    Shell/Bash
    npm i -g @sap/cds-dk

    This process takes some minutes installing the cds command, which you will use in the next steps.

    On MacOS/Linux, you need to follow the steps as described here.

    If there’s an older @sap/cds package already installed on your machine, you have to remove it first; if so, you’ll be instructed to do so.

    In case of problems, see the Troubleshooting guide in the CAP documentation for more details.

  2. To verify that the installation was successful, run cds without arguments:

    Shell/Bash
    cds

    cds commands
    cds commands

    This lists the available cds commands. For example, use cds --version to check the version that you’ve installed. To know what is the latest version, see the Release Notes for CAP.

Step 2 Install VS Code extension
+
Step 3 Start project
+
Step 4 Define your first service
+
Step 5 Provide mock data
+
Step 6 Add data model and adapt service definition
+
Step 7 Add initial data
+
Step 8 Add persistent database
+
Step 9 Test generic handlers
+
Step 10 Add custom logic
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 10
1. Set up local development environment 2. Install VS Code extension 3. Start project 4. Define your first service 5. Provide mock data 6. Add data model and adapt service definition 7. Add initial data 8. Add persistent database 9. Test generic handlers 10. Add custom logic

Learn more →