Web App with Node.js, Express and Aerospike

Let’s get you to write your first “Hello World” like web app using Node.js, Express and Aerospike, shall we? I promise it will only take n minutes of your time. Before we get started though, here’s an overview of what you will build in the next few minutes. A web app that will: Connect to the Aerospike database Allow you to enter name on a web page Store the name you entered into the Aerospike database Read the name back and display it on the web page like so “Hello Dash!” In the coming sections we’ll look at the code snippets but you may also download the source from GitHub Prerequisite: Node.js — if you don’t have it installed, get it done and come back here. Step 1: Install Aerospike Database Step 2: Application Setup Create a new folder (e.g. node-express-aerospike-app) for this new little application you’re going to write. Create a new file named package.json and add the following code. Make sure you save this file in the application folder. { “name”: “aerospike-node-express-seed-app”, “version”: “0.0.0-1”, “dependencies”: { “express”: “~4.0.0”, “aerospike”: “^1.0.7” } } What’s going on here? Well, this code suggests that the application will depend on two external libraries: Express and Aerospike Node.js Client. Resolve dependencies — open terminal […]