SAP

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
Elena Grigorova E Elena Grigorova November 1, 2022
Created on 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
Next