Connect to HXE using Node.js

Connect to HXE using Node.js

Use Node.js to connect and read data from your SAP HANA express edition

Details

You will learn

Now that your system is setup to work with both Node.js and the HDB library it is time to make your initial application and make your connection.

Step 1: Create your application directory

To begin with you will need to create a new directory where you will keep your files for this project. For the purposes of this tutorial it really does not matter what you call but for consistency it will be referred to here as hxe_bikeshare

Step 2: Set your connection parameters

Now that you have your directory it is time to start your new Node.js application. The easiest way to do this is by running the command from your newly created directory.

npm init

This will launch a wizard to help you create your new application.

The result will be a package.json file being created which defines various aspects of the application.

Step 3: Be sure HDB is available

If you did not use the -g flag on the npm install hdb command from the previous tutorial you will need to run the following command now.

npm install hdb --save

By running that command it will automatically add the hdb module as a dependency for your application which is very important if you plan on deploying your application to a server later on.