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 Basic Node.js Application with Express Generator

Create a Node.js application skeleton with Express Generator and add some snippets into the backend as a basic application.

Overview

🎓 beginner 25 min. SAP Btp, Kyma RuntimeBeginnerNode Js

You will learn

  • โœ”How to create a Node.js application skeleton with Node.js Express generator
  • โœ”How to develop a particular endpoint to respond to client requests
Unknown U Unknown November 1, 2022
Created by April 1, 2022
Contributors

Prerequisites

Prerequisites

Steps

Step 1 Create Node.js Application Skeleton
โ€”

You can use the application generator tool Node.js Express generator to quickly create a Node.js application skeleton.

Before that, create a new directory for your project:

Shell
mkdir multitenancy-kyma-tutorial

Under the multitenancy-kyma-tutorial directory, create your own Node.js Application.

Option 1: Run the application generator to create application skeleton with single one npx command (available in Node.js 8.2.0):

Shell
npx express-generator --view=jade kyma-multitenant-node

Option 2: Run the application generator to create application skeleton with command npm and express, by this way, packages will be saved locally as well.

Install the tool:

Shell
npm install -g express-generator

Package express is installed together.

Verify if you have successfully installed the tool:

Shell
express --version

Create an application skeleton:

Shell
express --view=jade kyma-multitenant-node

project-tree
project-tree

The generated app has the following directory structure:

Code
.
โ”œโ”€โ”€ app.js
โ”œโ”€โ”€ bin
โ”‚ย ย  โ””โ”€โ”€ www
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ public
โ”‚ย ย  โ”œโ”€โ”€ images
โ”‚ย ย  โ”œโ”€โ”€ javascripts
โ”‚ย ย  โ””โ”€โ”€ stylesheets
โ”‚ย ย      โ””โ”€โ”€ style.css
โ”œโ”€โ”€ routes
โ”‚ย ย  โ”œโ”€โ”€ index.js
โ”‚ย ย  โ””โ”€โ”€ users.js
โ””โ”€โ”€ views
    โ”œโ”€โ”€ error.jade
    โ”œโ”€โ”€ index.jade
    โ””โ”€โ”€ layout.jade

7 directories, 9 files
Step 2 Add Code Snippets into Node.js Application
+
Step 3 Project Repository
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Create Node.js Application Skeleton 2. Add Code Snippets into Node.js Application 3. Project Repository

Learn more →