Creating and Deploying a Basic OData service using the SAP Cloud Application Programming Model Model

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Create, run, export, and deploy a Node.js module saying Hello World

Creating the Hello World OData service using the SAP Cloud Application Programming Model Model

Watch this video to learn how to create the Hello World OData service using the SAP Cloud Application Programming Model Model.

  • Define a Service :

    We define a service using CDS

  • Implement It :

    We implement the code using example,

    Node.js express.js handlers style

    Node.js es6 classes style.

  • Run It :

    You can run it using command line commands, cds run or cds watch or cds serve world.cds

  • Consume It :

    Consumption is using the local browser http://localhost:4004/say/hello(to='world')

Code Reference

Code snippet
service srv{     function hello (to:String) returns String; } module.exports = class srv {   hello(req) { return `Hello ${req.data.to}!` } } 
Copy code

Creating the Hello World OData service using the SAP CAP Model

Save progress to your learning plan by logging in or creating an account

Login or Register